public inbox for libc-hacker@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] Fix IEEE quad lrintl
@ 2006-09-24  7:05 Jakub Jelinek
  0 siblings, 0 replies; only message in thread
From: Jakub Jelinek @ 2006-09-24  7:05 UTC (permalink / raw)
  To: Ulrich Drepper; +Cc: Glibc hackers

Hi!

Stupid typos cause it not to be properly rounded - the result
of the rounding (r) was unused, while GET_LDOUBLE_WORDS64 was
computing exactly what has been already computed, as x hasn't changed
in between.

2006-09-24  Jakub Jelinek  <jakub@redhat.com>

	* sysdeps/ieee754/ldbl-128/s_lrintl.c (__lrintl): Fix 2 typos.

--- libc/sysdeps/ieee754/ldbl-128/s_lrintl.c.jj	2006-09-20 23:00:13.000000000 +0200
+++ libc/sysdeps/ieee754/ldbl-128/s_lrintl.c	2006-09-24 08:52:27.000000000 +0200
@@ -50,7 +50,7 @@ __lrintl (long double x)
     {
       w = two112[sx] + x;
       t = w - two112[sx];
-      GET_LDOUBLE_WORDS64 (i0, i1, x);
+      GET_LDOUBLE_WORDS64 (i0, i1, t);
       j0 = ((i0 >> 48) & 0x7fff) - 0x3fff;
       i0 &= 0x0000ffffffffffffLL;
       i0 |= 0x0001000000000000LL;
@@ -65,7 +65,7 @@ __lrintl (long double x)
 	{
 	  w = two112[sx] + x;
 	  t = w - two112[sx];
-	  GET_LDOUBLE_WORDS64 (i0, i1, x);
+	  GET_LDOUBLE_WORDS64 (i0, i1, t);
 	  j0 = ((i0 >> 48) & 0x7fff) - 0x3fff;
 	  i0 &= 0x0000ffffffffffffLL;
 	  i0 |= 0x0001000000000000LL;

	Jakub

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2006-09-24  7:05 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-09-24  7:05 [PATCH] Fix IEEE quad lrintl Jakub Jelinek

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).