diff options
author | Alan Modra <amodra@gmail.com> | 2014-04-16 19:33:32 +0930 |
---|---|---|
committer | Alan Modra <amodra@gmail.com> | 2014-04-16 19:33:32 +0930 |
commit | aa5f0ff11ad2cc85277c64cf65c723a9664e1149 (patch) | |
tree | 841c809e5a067dfc91478956a8549f05fccee250 /math | |
parent | bb9c256fb01b09bc13a58ada3ea045ac9efd4834 (diff) | |
download | glibc-aa5f0ff11ad2cc85277c64cf65c723a9664e1149.tar glibc-aa5f0ff11ad2cc85277c64cf65c723a9664e1149.tar.gz glibc-aa5f0ff11ad2cc85277c64cf65c723a9664e1149.tar.bz2 glibc-aa5f0ff11ad2cc85277c64cf65c723a9664e1149.zip |
Correct IBM long double frexpl.
Besides fixing the bugzilla, this also fixes corner-cases where the high
and low double differ greatly in magnitude, and handles a denormal
input without resorting to a fp rescale.
[BZ #16740]
[BZ #16619]
* sysdeps/ieee754/ldbl-128ibm/s_frexpl.c (__frexpl): Rewrite.
* math/libm-test.inc (frexp_test_data): Add tests.
Diffstat (limited to 'math')
-rw-r--r-- | math/libm-test.inc | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/math/libm-test.inc b/math/libm-test.inc index 5e6789f9fb..a4bf0b88c3 100644 --- a/math/libm-test.inc +++ b/math/libm-test.inc @@ -7186,6 +7186,15 @@ static const struct test_f_f1_data frexp_test_data[] = TEST_fI_f1 (frexp, 12.8L, 0.8L, 4, NO_INEXACT_EXCEPTION), TEST_fI_f1 (frexp, -27.34L, -0.854375L, 5, NO_INEXACT_EXCEPTION), + +#if defined TEST_LDOUBLE && LDBL_MANT_DIG >= 106 + TEST_fI_f1 (frexp, 1.0L-0x1p-106L, 1.0L-0x1p-106L, 0, NO_INEXACT_EXCEPTION), + TEST_fI_f1 (frexp, 1.0L, 0.5L, 1, NO_INEXACT_EXCEPTION), + TEST_fI_f1 (frexp, 1.0L+0x1p-105L, 0.5L+0x1p-106L, 1, NO_INEXACT_EXCEPTION), + TEST_fI_f1 (frexp, -1.0L+0x1p-106L, -1.0L+0x1p-106L, 0, NO_INEXACT_EXCEPTION), + TEST_fI_f1 (frexp, -1.0L, -0.5L, 1, NO_INEXACT_EXCEPTION), + TEST_fI_f1 (frexp, -1.0L-0x1p-105L, -0.5L-0x1p-106L, 1, NO_INEXACT_EXCEPTION), +#endif }; static void |