summaryrefslogtreecommitdiffstats
path: root/lib/msun/arm
diff options
context:
space:
mode:
authorbde <bde@FreeBSD.org>2008-02-12 17:11:36 +0000
committerbde <bde@FreeBSD.org>2008-02-12 17:11:36 +0000
commitd22d4d735788cbfd2d8a91b701bbbf2f3d119055 (patch)
tree0e8457e7f7414d2bf7bea16e32b44ecb8ccbeaba /lib/msun/arm
parentdb8258708bf8a571518d133c84f7d5e0bbea8368 (diff)
downloadFreeBSD-src-d22d4d735788cbfd2d8a91b701bbbf2f3d119055.zip
FreeBSD-src-d22d4d735788cbfd2d8a91b701bbbf2f3d119055.tar.gz
Fix remainder() and remainderf() in round-towards-minus-infinity mode
when the result is +-0. IEEE754 requires (in all rounding modes) that if the result is +-0 then its sign is the same as that of the first arg, but in round-towards-minus-infinity mode an uncorrected implementation detail always reversed the sign. (The detail is that x-x with x's sign positive gives -0 in this mode only, but the algorithm assumed that x-x always has positive sign for such x.) remquo() and remquof() seem to need the same fix, but I cannot test them yet. Use long doubles when mixing NaN args. This trick improves consistency of results on at least amd64, so that more serious problems like the above aren't hidden in simple regression tests by noise for the NaNs. On amd64, hardware remainder should be used since it is about 10 times faster than software remainder and is already used for remquo(), but it involves using the i387 even for floats and doubles, and the i387 does NaN mixing which is better than but inconsistent with SSE NaN mixing. Software remainder() would probably have been inconsistent with software remainderl() for the same reason if the latter existed. Signaling NaNs cause further inconsistencies on at least ia64 and i386. Use __FBSDID().
Diffstat (limited to 'lib/msun/arm')
0 files changed, 0 insertions, 0 deletions
OpenPOWER on IntegriCloud