aboutsummaryrefslogtreecommitdiff
path: root/math
diff options
context:
space:
mode:
authorJoseph Myers <joseph@codesourcery.com>2016-06-06 22:10:11 +0000
committerJoseph Myers <joseph@codesourcery.com>2016-06-06 22:10:11 +0000
commitaf0cfbaf1df1549ca0bc70bd6b4bc54004d11680 (patch)
tree098497c0884048b37effc5a287a1a5786c5dd752 /math
parentc24480ce3b5fed848243fc9642932ef2fa670109 (diff)
downloadglibc-af0cfbaf1df1549ca0bc70bd6b4bc54004d11680.zip
glibc-af0cfbaf1df1549ca0bc70bd6b4bc54004d11680.tar.gz
glibc-af0cfbaf1df1549ca0bc70bd6b4bc54004d11680.tar.bz2
Fix dbl-64 acos (sNaN) (bug 20212).
The dbl-64 version of acos returns sNaN for sNaN arguments. This patch fixes it to add NaN arguments to themselves so that qNaN is returned in this case. Tested for x86_64 and x86. [BZ #20212] * sysdeps/ieee754/dbl-64/e_asin.c (__ieee754_acos): Add NaN argument to itself. * math/libm-test.inc (acos_test_data): Add sNaN tests.
Diffstat (limited to 'math')
-rw-r--r--math/libm-test.inc2
1 files changed, 2 insertions, 0 deletions
diff --git a/math/libm-test.inc b/math/libm-test.inc
index aaa0148..6981720 100644
--- a/math/libm-test.inc
+++ b/math/libm-test.inc
@@ -1799,6 +1799,8 @@ static const struct test_f_f_data acos_test_data[] =
TEST_f_f (acos, minus_infty, qnan_value, INVALID_EXCEPTION|ERRNO_EDOM),
TEST_f_f (acos, qnan_value, qnan_value, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
TEST_f_f (acos, -qnan_value, qnan_value, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
+ TEST_f_f (acos, snan_value, qnan_value, INVALID_EXCEPTION),
+ TEST_f_f (acos, -snan_value, qnan_value, INVALID_EXCEPTION),
/* |x| > 1: */
TEST_f_f (acos, 1.125L, qnan_value, INVALID_EXCEPTION|ERRNO_EDOM),