summaryrefslogtreecommitdiff
path: root/math
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2014-04-02 13:46:19 +1030
committerAlan Modra <amodra@gmail.com>2014-04-02 13:46:19 +1030
commitb0abbc21034f0e5edc49023d8fda0616173faf17 (patch)
tree0fed607adb9e4140a33d412fe9d6ec187fd403ac /math
parentaf6b17973cbc07ac06cfb40eeab5cc2391fb489a (diff)
downloadglibc-b0abbc21034f0e5edc49023d8fda0616173faf17.tar.gz
Correct IBM long double nextafterl.
Fix for values near a power of two, and some tidies. [BZ #16739] * sysdeps/ieee754/ldbl-128ibm/s_nextafterl.c (__nextafterl): Correct output when value is near a power of two. Use int64_t for lx and remove casts. Use decimal rather than hex exponent constants. Don't use long double multiplication when double will suffice. * math/libm-test.inc (nextafter_test_data): Add tests. * NEWS: Add 16739 and 16786 to bug list.
Diffstat (limited to 'math')
-rw-r--r--math/libm-test.inc8
1 files changed, 8 insertions, 0 deletions
diff --git a/math/libm-test.inc b/math/libm-test.inc
index 19194f63e9..967b679e94 100644
--- a/math/libm-test.inc
+++ b/math/libm-test.inc
@@ -8302,6 +8302,14 @@ static const struct test_ff_f_data nextafter_test_data[] =
// XXX Enable once gcc is fixed.
//TEST_ff_f (nextafter, 0x0.00000040000000000000p-16385L, -0.1L, 0x0.0000003ffffffff00000p-16385L),
#endif
+#if defined TEST_LDOUBLE && LDBL_MANT_DIG == 106
+ TEST_ff_f (nextafter, 1.0L, -10.0L, 1.0L-0x1p-106L, NO_EXCEPTION),
+ TEST_ff_f (nextafter, 1.0L, 10.0L, 1.0L+0x1p-105L, NO_EXCEPTION),
+ TEST_ff_f (nextafter, 1.0L-0x1p-106L, 10.0L, 1.0L, NO_EXCEPTION),
+ TEST_ff_f (nextafter, -1.0L, -10.0L, -1.0L-0x1p-105L, NO_EXCEPTION),
+ TEST_ff_f (nextafter, -1.0L, 10.0L, -1.0L+0x1p-106L, NO_EXCEPTION),
+ TEST_ff_f (nextafter, -1.0L+0x1p-106L, -10.0L, -1.0L, NO_EXCEPTION),
+#endif
/* XXX We need the hexadecimal FP number representation here for further
tests. */