about summary refs log tree commit diff
path: root/sysdeps/ieee754/ldbl-128/s_lrintl.c
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2004-02-12 21:00:59 +0000
committerUlrich Drepper <drepper@redhat.com>2004-02-12 21:00:59 +0000
commit39007ae35d9deebe05465bb3aa73b08b8b94b35b (patch)
treeb2b07f8e5cda0ddc53b070c29d6b5af7799b3b73 /sysdeps/ieee754/ldbl-128/s_lrintl.c
parent02860e478169f80f2ce15d58703929ac6ad7e4b0 (diff)
downloadglibc-39007ae35d9deebe05465bb3aa73b08b8b94b35b.tar.gz
glibc-39007ae35d9deebe05465bb3aa73b08b8b94b35b.tar.xz
glibc-39007ae35d9deebe05465bb3aa73b08b8b94b35b.zip
Update.
2004-02-12  Jakub Jelinek  <jakub@redhat.com>

	* math/libm-test.inc (lrint_test): Add new test.
	(llrint_test, lround_test, llround_test): Likewise.
	* sysdeps/ieee754/ldbl-128/s_lroundl.c (__lroundl): Fix special case
	with result taking up 48 bits.
	* sysdeps/ieee754/ldbl-128/s_lrintl.c (__lrintl): Likewise.
	* sysdeps/ieee754/ldbl-128/s_llroundl.c (__llroundl): Likewise.
	* sysdeps/ieee754/ldbl-96/s_llrintl.c (__llrintl): Fix special case
	with result taking up 31 bits.
Diffstat (limited to 'sysdeps/ieee754/ldbl-128/s_lrintl.c')
-rw-r--r--sysdeps/ieee754/ldbl-128/s_lrintl.c7
1 files changed, 5 insertions, 2 deletions
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