summary refs log tree commit diff
path: root/stdlib/gen-tst-strtod-round.c
diff options
context:
space:
mode:
authorJoseph Myers <joseph@codesourcery.com>2013-06-13 15:41:58 +0000
committerJoseph Myers <joseph@codesourcery.com>2013-06-13 15:41:58 +0000
commit1f24b9ad0f173f7904b7a0fd559cc287660be1b2 (patch)
treeabcd0da7d44a048767869b08a5dd14adeff9200d /stdlib/gen-tst-strtod-round.c
parentb406406a4fc001478ae65e7bcf930fbcf8ca01ee (diff)
downloadglibc-1f24b9ad0f173f7904b7a0fd559cc287660be1b2.tar.gz
glibc-1f24b9ad0f173f7904b7a0fd559cc287660be1b2.tar.xz
glibc-1f24b9ad0f173f7904b7a0fd559cc287660be1b2.zip
Rework tst-strtod-round handling of inexact results.
Diffstat (limited to 'stdlib/gen-tst-strtod-round.c')
-rw-r--r--stdlib/gen-tst-strtod-round.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/stdlib/gen-tst-strtod-round.c b/stdlib/gen-tst-strtod-round.c
index 6615819e07..c0634e0179 100644
--- a/stdlib/gen-tst-strtod-round.c
+++ b/stdlib/gen-tst-strtod-round.c
@@ -57,7 +57,7 @@ print_fp (mpfr_t f, const char *suffix, const char *suffix2)
 
 static void
 round_str (const char *s, const char *suffix,
-	   int prec, int emin, int emax, bool need_exact)
+	   int prec, int emin, int emax, bool ibm_ld)
 {
   mpfr_t f;
   mpfr_set_default_prec (prec);
@@ -65,7 +65,7 @@ round_str (const char *s, const char *suffix,
   mpfr_set_emax (emax);
   mpfr_init (f);
   int r = string_to_fp (f, s, MPFR_RNDD);
-  if (need_exact)
+  if (ibm_ld)
     {
       assert (prec == 106 && emin == -1073 && emax == 1024);
       /* The maximum value in IBM long double has discontiguous
@@ -76,9 +76,9 @@ round_str (const char *s, const char *suffix,
 		    MPFR_RNDN);
       if (mpfr_cmpabs (f, max_value) > 0)
 	r = 1;
-      mpfr_printf ("\t%s,\n", r ? "false" : "true");
       mpfr_clear (max_value);
     }
+  mpfr_printf ("\t%s,\n", r ? "false" : "true");
   print_fp (f, suffix, ",\n");
   string_to_fp (f, s, MPFR_RNDN);
   print_fp (f, suffix, ",\n");
@@ -97,7 +97,7 @@ round_for_all (const char *s)
     int prec;
     int emin;
     int emax;
-    bool need_exact;
+    bool ibm_ld;
   } formats[7] = {
     { "f", 24, -148, 128, false },
     { "", 53, -1073, 1024, false },
@@ -122,7 +122,7 @@ round_for_all (const char *s)
   for (i = 0; i < 7; i++)
     {
       round_str (s, formats[i].suffix, formats[i].prec,
-		 formats[i].emin, formats[i].emax, formats[i].need_exact);
+		 formats[i].emin, formats[i].emax, formats[i].ibm_ld);
       if (i < 6)
 	mpfr_printf (",\n");
     }