diff options
author | Joseph Myers <joseph@codesourcery.com> | 2012-05-06 18:20:21 +0000 |
---|---|---|
committer | Joseph Myers <joseph@codesourcery.com> | 2012-05-06 18:20:21 +0000 |
commit | 6c23e11c4dd036e65073d4e4d6bc971a445deaea (patch) | |
tree | 1b9c56995492fdc9fc46f0609769b75b494eacc4 /math/libm-test.inc | |
parent | 62881be42dd5a81785f630658c6762b214056978 (diff) | |
download | glibc-6c23e11c4dd036e65073d4e4d6bc971a445deaea.tar.gz glibc-6c23e11c4dd036e65073d4e4d6bc971a445deaea.tar.xz glibc-6c23e11c4dd036e65073d4e4d6bc971a445deaea.zip |
Fix libm-test.inc ulps calculation for subnormals (bug 14064).
Diffstat (limited to 'math/libm-test.inc')
-rw-r--r-- | math/libm-test.inc | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/math/libm-test.inc b/math/libm-test.inc index 59192ed0c5..d65c3e5844 100644 --- a/math/libm-test.inc +++ b/math/libm-test.inc @@ -503,8 +503,9 @@ check_float_internal (const char *test_name, FLOAT computed, FLOAT expected, 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))); + /* 1ulp for a subnormal value, shifted by MANT_DIG, is the + least normal value. */ + ulp = (FUNC(ldexp) (diff, MANT_DIG) / min_value); break; default: /* It should never happen. */ |