aboutsummaryrefslogtreecommitdiff
path: root/sysdeps/ieee754/dbl-64/s_llrint.c
diff options
context:
space:
mode:
Diffstat (limited to 'sysdeps/ieee754/dbl-64/s_llrint.c')
-rw-r--r--sysdeps/ieee754/dbl-64/s_llrint.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/sysdeps/ieee754/dbl-64/s_llrint.c b/sysdeps/ieee754/dbl-64/s_llrint.c
index 88e8136d49..893bd716b5 100644
--- a/sysdeps/ieee754/dbl-64/s_llrint.c
+++ b/sysdeps/ieee754/dbl-64/s_llrint.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.
@@ -75,7 +75,10 @@ __llrint (double x)
i0 &= 0xfffff;
i0 |= 0x100000;
- result = ((long long int) i0 << (j0 - 20)) | (i1 >> (52 - j0));
+ if (j0 == 20)
+ result = (long long int) i0;
+ else
+ result = ((long long int) i0 << (j0 - 20)) | (i1 >> (52 - j0));
}
}
else