about summary refs log tree commit diff
path: root/sysdeps/ieee754
diff options
context:
space:
mode:
Diffstat (limited to 'sysdeps/ieee754')
-rw-r--r--sysdeps/ieee754/ldbl-128/s_llroundl.c7
-rw-r--r--sysdeps/ieee754/ldbl-128/s_lrintl.c7
-rw-r--r--sysdeps/ieee754/ldbl-128/s_lroundl.c7
-rw-r--r--sysdeps/ieee754/ldbl-96/s_llrintl.c4
4 files changed, 17 insertions, 8 deletions
diff --git a/sysdeps/ieee754/ldbl-128/s_llroundl.c b/sysdeps/ieee754/ldbl-128/s_llroundl.c
index 9129c15e1f..b4609cdfd0 100644
--- a/sysdeps/ieee754/ldbl-128/s_llroundl.c
+++ b/sysdeps/ieee754/ldbl-128/s_llroundl.c
@@ -1,5 +1,5 @@
 /* Round long double value to long long int.
-   Copyright (C) 1997, 1999 Free Software Foundation, Inc.
+   Copyright (C) 1997, 1999, 2004 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997 and
    		  Jakub Jelinek <jj@ultra.linux.cz>, 1999.
@@ -58,7 +58,10 @@ __llroundl (long double x)
 	  if (j < i1)
 	    ++i0;
 
-	  result = ((long long int) i0 << (j0 - 48)) | (j >> (112 - j0));
+	  if (j0 == 48)
+	    result = (long long int) i0;
+	  else
+	    result = ((long long int) i0 << (j0 - 48)) | (j >> (112 - j0));
 	}
     }
   else
diff --git a/sysdeps/ieee754/ldbl-128/s_lrintl.c b/sysdeps/ieee754/ldbl-128/s_lrintl.c
index 350b100b9b..66f9a429fc 100644
--- a/sysdeps/ieee754/ldbl-128/s_lrintl.c
+++ b/sysdeps/ieee754/ldbl-128/s_lrintl.c
@@ -1,6 +1,6 @@
 /* Round argument to nearest integral value according to current rounding
    direction.
-   Copyright (C) 1997, 1999 Free Software Foundation, Inc.
+   Copyright (C) 1997, 1999, 2004 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997 and
    		  Jakub Jelinek <jj@ultra.linux.cz>, 1999.
@@ -75,7 +75,10 @@ __lrintl (long double x)
 	  i0 &= 0x0000ffffffffffffLL;
 	  i0 |= 0x0001000000000000LL;
 
-	  result = ((long int) i0 << (j0 - 48)) | (i1 >> (112 - j0));
+	  if (j0 == 48)
+	    result = (long int) i0;
+	  else
+	    result = ((long int) i0 << (j0 - 48)) | (i1 >> (112 - j0));
 	}
     }
   else
diff --git a/sysdeps/ieee754/ldbl-128/s_lroundl.c b/sysdeps/ieee754/ldbl-128/s_lroundl.c
index 2a941a1474..1346a04615 100644
--- a/sysdeps/ieee754/ldbl-128/s_lroundl.c
+++ b/sysdeps/ieee754/ldbl-128/s_lroundl.c
@@ -1,5 +1,5 @@
 /* Round long double value to long int.
-   Copyright (C) 1997, 1999 Free Software Foundation, Inc.
+   Copyright (C) 1997, 1999, 2004 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997 and
    		  Jakub Jelinek <jj@ultra.linux.cz>, 1999.
@@ -58,7 +58,10 @@ __lroundl (long double x)
 	  if (j < i1)
 	    ++i0;
 
-	  result = ((long int) i0 << (j0 - 48)) | (j >> (112 - j0));
+	  if (j0 == 48)
+	    result = (long int) i0;
+	  else
+	    result = ((long int) i0 << (j0 - 48)) | (j >> (112 - j0));
 	}
     }
   else
diff --git a/sysdeps/ieee754/ldbl-96/s_llrintl.c b/sysdeps/ieee754/ldbl-96/s_llrintl.c
index 665abe204f..e927a8af40 100644
--- a/sysdeps/ieee754/ldbl-96/s_llrintl.c
+++ b/sysdeps/ieee754/ldbl-96/s_llrintl.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.
 
@@ -58,7 +58,7 @@ __llrintl (long double x)
 	  GET_LDOUBLE_WORDS (se, i0, i1, t);
 	  j0 = (se & 0x7fff) - 0x3fff;
 
-	  if (j0 < 31)
+	  if (j0 <= 31)
 	    result = i0 >> (31 - j0);
 	  else
 	    result = ((long long int) i0 << (j0 - 31)) | (i1 >> (63 - j0));