about summary refs log tree commit diff
diff options
context:
space:
mode:
authorAndreas Schwab <schwab@suse.de>2001-10-18 11:46:36 +0000
committerAndreas Schwab <schwab@suse.de>2001-10-18 11:46:36 +0000
commit303f1335a3bd03be9e8ba5b5adc8ef1c36fac25a (patch)
treeb985a63f2337bb3374ae6c3137b5ada37fa5185d
parent692acf3723401e90aebf8e6665ffaa3f52fd0bec (diff)
downloadglibc-303f1335a3bd03be9e8ba5b5adc8ef1c36fac25a.tar.gz
glibc-303f1335a3bd03be9e8ba5b5adc8ef1c36fac25a.tar.xz
glibc-303f1335a3bd03be9e8ba5b5adc8ef1c36fac25a.zip
* math/libm-test.inc (print_ulps): Print ulp values rounded to
	next whole number.
	(print_function_ulps): Likewise.
	(print_complex_function_ulps): Likewise.
	(print_max_error): Likewise.
	(print_complex_max_error): Likewise.  Handle ignore_max_ulp.
-rw-r--r--ChangeLog9
-rw-r--r--math/libm-test.inc42
2 files changed, 35 insertions, 16 deletions
diff --git a/ChangeLog b/ChangeLog
index 9ec8bb3608..843b329f46 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2001-10-18  Andreas Schwab  <schwab@suse.de>
+
+	* math/libm-test.inc (print_ulps): Print ulp values rounded to
+	next whole number.
+	(print_function_ulps): Likewise.
+	(print_complex_function_ulps): Likewise.
+	(print_max_error): Likewise.
+	(print_complex_max_error): Likewise.  Handle ignore_max_ulp.
+
 2001-10-16  Andreas Schwab  <schwab@suse.de>
 
 	* sysdeps/m68k/fpu/libm-test-ulps: Updated for fixed cbrtl
diff --git a/math/libm-test.inc b/math/libm-test.inc
index 9c56e1cbc8..655bf4530d 100644
--- a/math/libm-test.inc
+++ b/math/libm-test.inc
@@ -250,9 +250,10 @@ print_ulps (const char *test_name, FLOAT ulp)
   if (output_ulps)
     {
       fprintf (ulps_file, "Test \"%s\":\n", test_name);
-      fprintf (ulps_file, "%s: % .4" PRINTF_NEXPR "\n",
+      fprintf (ulps_file, "%s: %.0" PRINTF_NEXPR "\n",
 	       CHOOSE("ldouble", "double", "float",
-		      "ildouble", "idouble", "ifloat"), ulp);
+		      "ildouble", "idouble", "ifloat"),
+	       FUNC(ceil) (ulp));
     }
 }
 
@@ -262,9 +263,10 @@ print_function_ulps (const char *function_name, FLOAT ulp)
   if (output_ulps)
     {
       fprintf (ulps_file, "Function: \"%s\":\n", function_name);
-      fprintf (ulps_file, "%s: % .4" PRINTF_NEXPR "\n",
+      fprintf (ulps_file, "%s: %.0" PRINTF_NEXPR "\n",
 	       CHOOSE("ldouble", "double", "float",
-		      "ildouble", "idouble", "ifloat"), ulp);
+		      "ildouble", "idouble", "ifloat"),
+	       FUNC(ceil) (ulp));
     }
 }
 
@@ -278,16 +280,18 @@ print_complex_function_ulps (const char *function_name, FLOAT real_ulp,
       if (real_ulp != 0.0)
 	{
 	  fprintf (ulps_file, "Function: Real part of \"%s\":\n", function_name);
-	  fprintf (ulps_file, "%s: % .4" PRINTF_NEXPR "\n",
+	  fprintf (ulps_file, "%s: %.0" PRINTF_NEXPR "\n",
 		   CHOOSE("ldouble", "double", "float",
-			  "ildouble", "idouble", "ifloat"), real_ulp);
+			  "ildouble", "idouble", "ifloat"),
+		   FUNC(ceil) (real_ulp));
 	}
       if (imag_ulp != 0.0)
 	{
 	  fprintf (ulps_file, "Function: Imaginary part of \"%s\":\n", function_name);
-	  fprintf (ulps_file, "%s: % .4" PRINTF_NEXPR "\n",
+	  fprintf (ulps_file, "%s: %.0" PRINTF_NEXPR "\n",
 		   CHOOSE("ldouble", "double", "float",
-			  "ildouble", "idouble", "ifloat"), imag_ulp);
+			  "ildouble", "idouble", "ifloat"),
+		   FUNC(ceil) (imag_ulp));
 	}
 
 
@@ -336,8 +340,8 @@ print_max_error (const char *func_name, FLOAT allowed, int xfail)
   if (print_screen_max_error (ok, xfail))
     {
       printf ("Maximal error of `%s'\n", func_name);
-      printf (" is      : % .4" PRINTF_NEXPR " ulp\n", max_error);
-      printf (" accepted: % .4" PRINTF_NEXPR " ulp\n", allowed);
+      printf (" is      : %.0" PRINTF_NEXPR " ulp\n", FUNC(ceil) (max_error));
+      printf (" accepted: %.0" PRINTF_NEXPR " ulp\n", FUNC(ceil) (allowed));
     }
 
   update_stats (ok, xfail);
@@ -350,8 +354,10 @@ print_complex_max_error (const char *func_name, __complex__ FLOAT allowed,
 {
   int ok = 0;
 
-  if ((real_max_error <= __real__ allowed)
-      && (imag_max_error <= __imag__ allowed))
+  if ((real_max_error == 0 && imag_max_error == 0)
+      || (real_max_error <= __real__ allowed
+	  && imag_max_error <= __imag__ allowed
+	  && !ignore_max_ulp))
     {
       ok = 1;
     }
@@ -363,11 +369,15 @@ print_complex_max_error (const char *func_name, __complex__ FLOAT allowed,
   if (print_screen_max_error (ok, xfail))
     {
       printf ("Maximal error of real part of: %s\n", func_name);
-      printf (" is      : % .4" PRINTF_NEXPR " ulp\n", real_max_error);
-      printf (" accepted: % .4" PRINTF_NEXPR " ulp\n", __real__ allowed);
+      printf (" is      : %.0" PRINTF_NEXPR " ulp\n",
+	      FUNC(ceil) (real_max_error));
+      printf (" accepted: %.0" PRINTF_NEXPR " ulp\n",
+	      FUNC(ceil) (__real__ allowed));
       printf ("Maximal error of imaginary part of: %s\n", func_name);
-      printf (" is      : % .4" PRINTF_NEXPR " ulp\n", imag_max_error);
-      printf (" accepted: % .4" PRINTF_NEXPR " ulp\n", __imag__ allowed);
+      printf (" is      : %.0" PRINTF_NEXPR " ulp\n",
+	      FUNC(ceil) (imag_max_error));
+      printf (" accepted: %.0" PRINTF_NEXPR " ulp\n",
+	      FUNC(ceil) (__imag__ allowed));
     }
 
   update_stats (ok, xfail);