diff options
Diffstat (limited to 'sysdeps/ieee754/ldbl-96/s_lrintl.c')
-rw-r--r-- | sysdeps/ieee754/ldbl-96/s_lrintl.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/sysdeps/ieee754/ldbl-96/s_lrintl.c b/sysdeps/ieee754/ldbl-96/s_lrintl.c index b8af7aa9b2..4212093989 100644 --- a/sysdeps/ieee754/ldbl-96/s_lrintl.c +++ b/sysdeps/ieee754/ldbl-96/s_lrintl.c @@ -1,6 +1,6 @@ /* Round argument to nearest integral value according to current rounding direction. - 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. @@ -70,7 +70,10 @@ __lrintl (long double x) GET_LDOUBLE_WORDS (se, i0, i1, t); j0 = (se & 0x7fff) - 0x3fff; - result = ((long int) i0 << (j0 - 31)) | (i1 >> (63 - j0)); + if (j0 == 31) + result = (long int) i0; + else + result = ((long int) i0 << (j0 - 31)) | (i1 >> (63 - j0)); } } else |