Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1aMige-0000XZ-Ri for pgsql-hackers@arkaria.postgresql.org; Fri, 22 Jan 2016 20:52:04 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84) (envelope-from ) id 1aMige-0005qK-Bz for pgsql-hackers@arkaria.postgresql.org; Fri, 22 Jan 2016 20:52:04 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84) (envelope-from ) id 1aMifI-0002oe-IZ for pgsql-hackers@postgresql.org; Fri, 22 Jan 2016 20:50:40 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84) (envelope-from ) id 1aMifG-0004oI-6X for pgsql-hackers@postgresql.org; Fri, 22 Jan 2016 20:50:39 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id u0MKoVRB011879; Fri, 22 Jan 2016 15:50:31 -0500 From: Tom Lane To: Dean Rasheed cc: Michael Paquier , Peter Eisentraut , PostgreSQL Hackers Subject: Re: Proposal: Trigonometric functions in degrees In-reply-to: References: <562E82F7.2060704@gmx.net> <1671.1445890789@sss.pgh.pa.us> <5178.1445899865@sss.pgh.pa.us> <31706.1448892680@sss.pgh.pa.us> Comments: In-reply-to Dean Rasheed message dated "Sun, 17 Jan 2016 20:01:54 +0000" Date: Fri, 22 Jan 2016 15:50:31 -0500 Message-ID: <11878.1453495831@sss.pgh.pa.us> X-Pg-Spam-Score: -1.9 (-) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-hackers Precedence: bulk Sender: pgsql-hackers-owner@postgresql.org Dean Rasheed writes: > I tried using feclearexcept + fetestexcept as recommended by > POSIX.1-2008, and that does indeed make the above examples compliant > on my linux box. Unfortunately it introduces new errors -- asin starts > generating FE_UNDERFLOW errors for numbers that are really not that > small, such as asin(1e-9), although the function still returns the > correct answer. A bigger problem though is that these are C99 > functions and so won't necessarily be available on all supported > platforms. The latter issue could be dealt with via configure tests, but I agree that if we get new error conditions we weren't exactly looking for, it would not be a net improvement. I think ensuring that the Inf and NaN cases are platform-independent is already a good step forward, so we can stop there for now. > Attached are patches for this and the new functions in degrees, now > with POSIX compatible Inf/NaN handling. Pushed with minor, mostly cosmetic fixes. I did renumber the function OIDs to be closer to the original trig functions' numbers, using some OIDs that were freed up by the recent index AM API change. regards, tom lane -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers