Dean Rasheed <dean.a.rash...@gmail.com> 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 (email@example.com) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers