From 3d8b06bc6108aa20a6591f52e7d9cbbd63c20e0a Mon Sep 17 00:00:00 2001 From: Joseph Myers Date: Mon, 6 Jun 2016 22:21:11 +0000 Subject: Fix dbl-64 asin (sNaN) (bug 20213). The dbl-64 version of asin 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 #20213] * sysdeps/ieee754/dbl-64/e_asin.c (__ieee754_asin): Add NaN argument to itself. * math/libm-test.inc (asin_test_data): Add sNaN tests. --- sysdeps/ieee754/dbl-64/e_asin.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'sysdeps') diff --git a/sysdeps/ieee754/dbl-64/e_asin.c b/sysdeps/ieee754/dbl-64/e_asin.c index 5d5fb01132..23e9e7eddd 100644 --- a/sysdeps/ieee754/dbl-64/e_asin.c +++ b/sysdeps/ieee754/dbl-64/e_asin.c @@ -323,7 +323,7 @@ __ieee754_asin(double x){ /*---------------------------- |x|>=1 -------------------------------*/ else if (k==0x3ff00000 && u.i[LOW_HALF]==0) return (m>0)?hp0.x:-hp0.x; else - if (k>0x7ff00000 || (k == 0x7ff00000 && u.i[LOW_HALF] != 0)) return x; + if (k>0x7ff00000 || (k == 0x7ff00000 && u.i[LOW_HALF] != 0)) return x + x; else { u.i[HIGH_HALF]=0x7ff00000; v.i[HIGH_HALF]=0x7ff00000; -- cgit 1.4.1