This is the mail archive of the
glibc-cvs@sourceware.org
mailing list for the glibc project.
GNU C Library master sources branch, master, updated. glibc-2.14-268-g7f5517a
- From: drepper at sourceware dot org
- To: glibc-cvs at sourceware dot org
- Date: 9 Sep 2011 03:37:47 -0000
- Subject: GNU C Library master sources branch, master, updated. glibc-2.14-268-g7f5517a
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU C Library master sources".
The branch, master has been updated
via 7f5517aa5269af6cac791ca74111f817320b73f2 (commit)
from 5f69cd2f94fc7bf0a468bf0a5b53b32f2b7c468c (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=7f5517aa5269af6cac791ca74111f817320b73f2
commit 7f5517aa5269af6cac791ca74111f817320b73f2
Author: Paul Pluzhnikov <ppluzhnikov@google.com>
Date: Thu Sep 8 23:37:32 2011 -0400
Fix lround() loses precision
diff --git a/ChangeLog b/ChangeLog
index 6b12f3b..34e9e37 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2011-08-18 Paul Pluzhnikov <ppluzhnikov@google.com>
+ Ian Lance Taylor <iant@google.com>
+
+ * math/libm-test.inc (lround_test): New testcase.
+ * sysdeps/ieee754/dbl-64/s_lround.c (__lround): Don't lose precision.
+
2011-09-08 Ulrich Drepper <drepper@gmail.com>
* Makefile: Remove support for automatic cvs check-ins.
diff --git a/math/libm-test.inc b/math/libm-test.inc
index c6ed7a3..301d4a8 100644
--- a/math/libm-test.inc
+++ b/math/libm-test.inc
@@ -4386,6 +4386,7 @@ lround_test (void)
TEST_f_l (lround, 1073741824.01, 1073741824);
# if LONG_MAX > 281474976710656
TEST_f_l (lround, 281474976710656.025, 281474976710656);
+ TEST_f_l (llround, -3.65309740835E17, -365309740835000000);
# endif
TEST_f_l (lround, 2097152.5, 2097153);
TEST_f_l (lround, -2097152.5, -2097153);
diff --git a/sysdeps/ieee754/dbl-64/s_lround.c b/sysdeps/ieee754/dbl-64/s_lround.c
index 4e1302a..a849997 100644
--- a/sysdeps/ieee754/dbl-64/s_lround.c
+++ b/sysdeps/ieee754/dbl-64/s_lround.c
@@ -51,7 +51,7 @@ __lround (double x)
else if (j0 < (int32_t) (8 * sizeof (long int)) - 1)
{
if (j0 >= 52)
- result = ((long int) i0 << (j0 - 20)) | (i1 << (j0 - 52));
+ result = ((long int) i0 << (j0 - 20)) | ((long int) i1 << (j0 - 52));
else
{
u_int32_t j = i1 + (0x80000000 >> (j0 - 20));
-----------------------------------------------------------------------
Summary of changes:
ChangeLog | 6 ++++++
math/libm-test.inc | 1 +
sysdeps/ieee754/dbl-64/s_lround.c | 2 +-
3 files changed, 8 insertions(+), 1 deletions(-)
hooks/post-receive
--
GNU C Library master sources