mirror of
https://github.com/freebsd/freebsd-src
synced 2024-10-05 08:00:30 +00:00
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
This commit is contained in:
parent
61df86c1ed
commit
1186054263
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=153046
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue