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.16-ports-merge-298-ged8c2ec
- From: jsm28 at sourceware dot org
- To: glibc-cvs at sourceware dot org
- Date: 6 Sep 2012 15:33:36 -0000
- Subject: GNU C Library master sources branch master updated. glibc-2.16-ports-merge-298-ged8c2ec
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 ed8c2ecd21d07e9e116fc494742a2b3af8193144 (commit)
from 053406fa70d071423c43465d60042d84c24f94cf (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=ed8c2ecd21d07e9e116fc494742a2b3af8193144
commit ed8c2ecd21d07e9e116fc494742a2b3af8193144
Author: Joseph Myers <joseph@codesourcery.com>
Date: Thu Sep 6 15:33:06 2012 +0000
Fix strtod test for values above maximum for IBM long double.
diff --git a/ChangeLog b/ChangeLog
index b978444..a48a5cb 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2012-09-06 Joseph Myers <joseph@codesourcery.com>
+
+ * stdlib/gen-tst-strtod-round.c: Include <assert.h>.
+ (round_str): Handle values above the maximum for IBM long double
+ as inexact.
+ * stdlib/tst-strtod-round.c (tests): Regenerated.
+
2012-09-06 Andreas Krebbel <Andreas.Krebbel@de.ibm.com>
* sysdeps/s390/s390-32/multiarch/Makefile: Remove -mzarch
diff --git a/stdlib/gen-tst-strtod-round.c b/stdlib/gen-tst-strtod-round.c
index f4ad270..56aafab 100644
--- a/stdlib/gen-tst-strtod-round.c
+++ b/stdlib/gen-tst-strtod-round.c
@@ -18,6 +18,7 @@
<http://www.gnu.org/licenses/>. */
#define _GNU_SOURCE
+#include <assert.h>
#include <stdbool.h>
#include <stdio.h>
#include <stdlib.h>
@@ -65,7 +66,19 @@ round_str (const char *s, const char *suffix,
mpfr_init (f);
int r = string_to_fp (f, s, MPFR_RNDD);
if (need_exact)
- mpfr_printf ("\t%s,\n", r ? "false" : "true");
+ {
+ assert (prec == 106 && emin == -1073 && emax == 1024);
+ /* The maximum value in IBM long double has discontiguous
+ mantissa bits. */
+ mpfr_t max_value;
+ mpfr_init2 (max_value, 107);
+ mpfr_set_str (max_value, "0x1.fffffffffffff7ffffffffffffcp+1023", 0,
+ MPFR_RNDN);
+ if (mpfr_cmpabs (f, max_value) > 0)
+ r = 1;
+ mpfr_printf ("\t%s,\n", r ? "false" : "true");
+ mpfr_clear (max_value);
+ }
print_fp (f, suffix, ",\n");
string_to_fp (f, s, MPFR_RNDN);
print_fp (f, suffix, ",\n");
diff --git a/stdlib/tst-strtod-round.c b/stdlib/tst-strtod-round.c
index 1edeff6..c6ad126 100644
--- a/stdlib/tst-strtod-round.c
+++ b/stdlib/tst-strtod-round.c
@@ -1927,7 +1927,7 @@ static const struct test tests[] = {
0xf.ffffffffffffcp+1020L,
0xf.ffffffffffffcp+1020L,
0xf.ffffffffffffcp+1020L,
- true,
+ false,
0xf.ffffffffffffcp+1020L,
0xf.ffffffffffffcp+1020L,
0xf.ffffffffffffcp+1020L,
@@ -2032,7 +2032,7 @@ static const struct test tests[] = {
-0xf.ffffffffffffcp+1020L,
-0xf.ffffffffffffcp+1020L,
-0xf.ffffffffffffcp+1020L,
- true,
+ false,
-0xf.ffffffffffffcp+1020L,
-0xf.ffffffffffffcp+1020L,
-0xf.ffffffffffffcp+1020L,
-----------------------------------------------------------------------
Summary of changes:
ChangeLog | 7 +++++++
stdlib/gen-tst-strtod-round.c | 15 ++++++++++++++-
stdlib/tst-strtod-round.c | 4 ++--
3 files changed, 23 insertions(+), 3 deletions(-)
hooks/post-receive
--
GNU C Library master sources