aboutsummaryrefslogtreecommitdiff
path: root/math
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2014-04-16 19:33:32 +0930
committerAlan Modra <amodra@gmail.com>2014-04-16 19:33:32 +0930
commitaa5f0ff11ad2cc85277c64cf65c723a9664e1149 (patch)
tree841c809e5a067dfc91478956a8549f05fccee250 /math
parentbb9c256fb01b09bc13a58ada3ea045ac9efd4834 (diff)
downloadglibc-aa5f0ff11ad2cc85277c64cf65c723a9664e1149.zip
glibc-aa5f0ff11ad2cc85277c64cf65c723a9664e1149.tar.gz
glibc-aa5f0ff11ad2cc85277c64cf65c723a9664e1149.tar.bz2
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.inc9
1 files changed, 9 insertions, 0 deletions
diff --git a/math/libm-test.inc b/math/libm-test.inc
index 5e6789f..a4bf0b8 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