From 14cb0170de4ee04ce0f63eb8bc7eec963244de6a Mon Sep 17 00:00:00 2001 From: bde Date: Sat, 3 Dec 2005 09:00:29 +0000 Subject: 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 --- lib/msun/src/s_rintf.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'lib/msun/src') 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; -- cgit v1.1