diff options
author | Ulrich Drepper <drepper@redhat.com> | 2004-02-01 19:23:10 +0000 |
---|---|---|
committer | Ulrich Drepper <drepper@redhat.com> | 2004-02-01 19:23:10 +0000 |
commit | 3eb614154cb841e131cb1b9d213ef29f44b5fa10 (patch) | |
tree | e2fe7e7c449dfe69c69cde9db05dc238650b554d /sysdeps/ieee754/ldbl-96/s_lroundl.c | |
parent | 00c707414167a28e5d9499a3314a79e375f3e329 (diff) | |
download | glibc-3eb614154cb841e131cb1b9d213ef29f44b5fa10.tar.gz |
Update.
* math/libm-test.inc (lround_test): Add new test.
(llround_test): Likewise.
(lrint_test): Likewise.
(llrint_test): Likewise.
* sysdeps/ieee754/dbl-64/s_lround.c (__lround): Fix special case
with result taking up 20 bits.
* sysdeps/ieee754/dbl-64/s_lrint.c (__lrint): Likewise.
* sysdeps/ieee754/dbl-64/s_llrint.c (__llrint): Likewise..
* sysdeps/ieee754/ldbl-96/s_lroundl.c (__lroundl): Fix special
case with result taking up 31 bits.
* sysdeps/ieee754/ldbl-96/s_lrintl.c (__lrintl): Likewise.
Diffstat (limited to 'sysdeps/ieee754/ldbl-96/s_lroundl.c')
-rw-r--r-- | sysdeps/ieee754/ldbl-96/s_lroundl.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/sysdeps/ieee754/ldbl-96/s_lroundl.c b/sysdeps/ieee754/ldbl-96/s_lroundl.c index 32b6f6751e..217ce1b9e9 100644 --- a/sysdeps/ieee754/ldbl-96/s_lroundl.c +++ b/sysdeps/ieee754/ldbl-96/s_lroundl.c @@ -1,5 +1,5 @@ /* Round long double value to long int. - Copyright (C) 1997 Free Software Foundation, Inc. + Copyright (C) 1997, 2004 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997. @@ -62,7 +62,10 @@ __lroundl (long double x) if (j < i1) ++i0; - result = ((long int) i0 << (j0 - 31)) | (j >> (63 - j0)); + if (j0 == 31) + result = (long int) i0; + else + result = ((long int) i0 << (j0 - 31)) | (j >> (63 - j0)); } } else |