]> sourceware.org Git - glibc.git/commitdiff
[BZ #2549]
authorUlrich Drepper <drepper@redhat.com>
Sun, 28 Oct 2007 01:14:40 +0000 (01:14 +0000)
committerUlrich Drepper <drepper@redhat.com>
Sun, 28 Oct 2007 01:14:40 +0000 (01:14 +0000)
2006-04-14  H.J. Lu  <hongjiu.lu@intel.com>
[BZ #2549]
* math/libm-test.inc (check_float_internal): Support
denormalized return.

ChangeLog
math/libm-test.inc

index c61158200bf24c84465e780decd80de3a57be32d..91942faaabb64ec98ba2a632e70614f20b159151 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2006-04-14  H.J. Lu  <hongjiu.lu@intel.com>
+
+       [BZ #2549]
+       * math/libm-test.inc (check_float_internal): Support
+       denormalized return.
+
 2007-10-23  Andreas Jaeger  <aj@suse.de>
 
        [BZ #5208]
index da68d40bb475c59575e12775896254039bf138dc..e698923f4ebb7e3603bac151ddace4911cc8cfd3 100644 (file)
@@ -487,11 +487,24 @@ check_float_internal (const char *test_name, FLOAT computed, FLOAT expected,
   else
     {
       diff = FUNC(fabs) (computed - expected);
-      /* ilogb (0) isn't allowed.  */
-      if (expected == 0.0)
-       ulp = diff / FUNC(ldexp) (1.0, - MANT_DIG);
-      else
-       ulp = diff / FUNC(ldexp) (1.0, FUNC(ilogb) (expected) - MANT_DIG);
+      switch (fpclassify (expected))
+       {
+       case FP_ZERO:
+         /* ilogb (0) isn't allowed. */
+         ulp = diff / FUNC(ldexp) (1.0, - MANT_DIG);
+         break;
+       case FP_NORMAL:
+         ulp = diff / FUNC(ldexp) (1.0, FUNC(ilogb) (expected) - MANT_DIG);
+         break;
+       case FP_SUBNORMAL:
+         ulp = (FUNC(ldexp) (diff, MANT_DIG)
+                / FUNC(ldexp) (1.0, FUNC(ilogb) (expected)));
+         break;
+       default:
+         /* It should never happen. */
+         abort ();
+         break;
+       }
       set_max_error (ulp, curr_max_error);
       print_diff = 1;
       if ((exceptions & IGNORE_ZERO_INF_SIGN) == 0
This page took 0.054717 seconds and 5 git commands to generate.