summaryrefslogtreecommitdiffstats
path: root/lib/msun
diff options
context:
space:
mode:
authorbde <bde@FreeBSD.org>2005-12-03 09:00:29 +0000
committerbde <bde@FreeBSD.org>2005-12-03 09:00:29 +0000
commit14cb0170de4ee04ce0f63eb8bc7eec963244de6a (patch)
tree1719caab378e5cfeaadd82f3407275d2a099677c /lib/msun
parent737cb276f5017cb4b169b0b53ae5937053f003ca (diff)
downloadFreeBSD-src-14cb0170de4ee04ce0f63eb8bc7eec963244de6a.zip
FreeBSD-src-14cb0170de4ee04ce0f63eb8bc7eec963244de6a.tar.gz
Restored removal of the special handling needed for a result of +-0.
It was lost in rev.1.9. The log message for rev.1.9 says that the special case of +-0 is handled twice, but it was only handled once, so it became unhandled, and this happened to break half of the cases that return +-0: - round-towards-minus-infinity: 0 < x < 1: result was -0 not 0 - round-to-nearest: -0.5 <= x < 0: result was 0 not -0 - round-towards-plus-infinity: -1 < x < 0: result was 0 not -0 - round-towards-zero: -1 < x < 0: result was 0 not -0
Diffstat (limited to 'lib/msun')
-rw-r--r--lib/msun/src/s_rintf.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/msun/src/s_rintf.c b/lib/msun/src/s_rintf.c
index 429eac7..32697fb 100644
--- a/lib/msun/src/s_rintf.c
+++ b/lib/msun/src/s_rintf.c
@@ -40,6 +40,8 @@ rintf(float x)
if((i0&0x7fffffff)==0) return x;
w = TWO23[sx]+x;
t = w-TWO23[sx];
+ GET_FLOAT_WORD(i0,t);
+ SET_FLOAT_WORD(t,(i0&0x7fffffff)|(sx<<31));
return t;
}
w = TWO23[sx]+x;
OpenPOWER on IntegriCloud