summaryrefslogtreecommitdiff
path: root/math
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2007-12-12 18:13:35 +0000
committerJakub Jelinek <jakub@redhat.com>2007-12-12 18:13:35 +0000
commit574e283890a6ca92325a06dafa76ff307a8019a2 (patch)
tree055e44e24a55fb4863e5d9cdc04e320cde52ffe9 /math
parenta162e5955f7e324be82d9318bbcbe869c66ffb86 (diff)
Updated to fedora-glibc-20071212T1051
Diffstat (limited to 'math')
-rw-r--r--math/libm-test.inc23
1 files changed, 18 insertions, 5 deletions
diff --git a/math/libm-test.inc b/math/libm-test.inc
index da68d40bb4..e698923f4e 100644
--- a/math/libm-test.inc
+++ b/math/libm-test.inc
@@ -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