diff options
author | Jeff Johnston <jjohnstn@redhat.com> | 2005-09-08 21:03:54 +0000 |
---|---|---|
committer | Jeff Johnston <jjohnstn@redhat.com> | 2005-09-08 21:03:54 +0000 |
commit | 32b09d754fe438551432e74413d7f13689527b7f (patch) | |
tree | 8715707ec8d4a033a3e9a7682b15368f1c2d440d /newlib | |
parent | bd84404b0f279a82206c70e1aa090a6aaa21bf45 (diff) | |
download | newlib-32b09d754fe438551432e74413d7f13689527b7f.zip newlib-32b09d754fe438551432e74413d7f13689527b7f.tar.gz newlib-32b09d754fe438551432e74413d7f13689527b7f.tar.bz2 |
2005-09-08 Brian Dessent <brian@dessent.net>
* sf_lrint.c (lrintf): Mask 'i0' correctly when extracting
mantissa.
* s_lrint.c: Ditto.
Diffstat (limited to 'newlib')
-rw-r--r-- | newlib/ChangeLog | 6 | ||||
-rw-r--r-- | newlib/libm/common/s_lrint.c | 3 | ||||
-rw-r--r-- | newlib/libm/common/sf_lrint.c | 2 |
3 files changed, 9 insertions, 2 deletions
diff --git a/newlib/ChangeLog b/newlib/ChangeLog index 3171836..4c6c243 100644 --- a/newlib/ChangeLog +++ b/newlib/ChangeLog @@ -1,3 +1,9 @@ +2005-09-08 Brian Dessent <brian@dessent.net> + + * sf_lrint.c (lrintf): Mask 'i0' correctly when extracting + mantissa. + * s_lrint.c: Ditto. + 2005-09-02 Jeff Johnston <jjohnstn@redhat.com> * libc/include/stdio.h: Add prototype for viprintf. diff --git a/newlib/libm/common/s_lrint.c b/newlib/libm/common/s_lrint.c index 45759f1..7d3b561 100644 --- a/newlib/libm/common/s_lrint.c +++ b/newlib/libm/common/s_lrint.c @@ -83,7 +83,8 @@ TWO52[2]={ else if (j0 < (int)(8 * sizeof (long int)) - 1) { if (j0 >= 52) - result = ((long int) i0 << (j0 - 20)) | (i1 << (j0 - 52)); + result = ((long int) ((i0 & 0x000fffff) | 0x0010000) << (j0 - 20)) | + (i1 << (j0 - 52)); else { w = TWO52[sx] + x; diff --git a/newlib/libm/common/sf_lrint.c b/newlib/libm/common/sf_lrint.c index 427bbb6..3165705 100644 --- a/newlib/libm/common/sf_lrint.c +++ b/newlib/libm/common/sf_lrint.c @@ -63,7 +63,7 @@ TWO23[2]={ if (j0 < -1) return 0; else if (j0 >= 23) - result = (long int) i0 << (j0 - 23); + result = (long int) ((i0 & 0x7fffff) | 0x800000) << (j0 - 23); else { w = TWO23[sx] + x; |