pgsql: Yet more portability hacking for degree-based trig functions. - Mailing list pgsql-committers

From Tom Lane
Subject pgsql: Yet more portability hacking for degree-based trig functions.
Date
Msg-id E1av4qc-00040z-4Q@gemulon.postgresql.org
Whole thread Raw
List pgsql-committers
Yet more portability hacking for degree-based trig functions.

The true explanation for Peter Eisentraut's report of inexact asind results
seems to be that (a) he's compiling into x87 instruction set, which uses
wider-than-double float registers, plus (b) the library function asin() on
his platform returns a result that is wider than double and is not rounded
to double width.  To fix, we have to force the function's result to be
rounded comparably to what happened to the scaling constant asin_0_5.
Experimentation suggests that storing it into a volatile local variable is
the least ugly way of making that happen.  Although only asin() is known to
exhibit an observable inexact result, we'd better do this in all the places
where we're hoping to get an exact result by scaling.

Branch
------
master

Details
-------
http://git.postgresql.org/pg/commitdiff/82311bcdd76904b2cee7567e14e9fb0cf6c6178c

Modified Files
--------------
src/backend/utils/adt/float.c | 64 ++++++++++++++++++++++++++++++++++++-------
1 file changed, 54 insertions(+), 10 deletions(-)


pgsql-committers by date:

Previous
From: Robert Haas
Date:
Subject: pgsql: Enable parallel query by default.
Next
From: Tom Lane
Date:
Subject: pgsql: Fix order of shutdown cleanup operations in PostgresNode.pm.