about summary refs log tree commit diff
path: root/sysdeps/ieee754/dbl-64
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 /sysdeps/ieee754/dbl-64
parentc24480ce3b5fed848243fc9642932ef2fa670109 (diff)
downloadglibc-af0cfbaf1df1549ca0bc70bd6b4bc54004d11680.tar.gz
glibc-af0cfbaf1df1549ca0bc70bd6b4bc54004d11680.tar.xz
glibc-af0cfbaf1df1549ca0bc70bd6b4bc54004d11680.zip
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 'sysdeps/ieee754/dbl-64')
-rw-r--r--sysdeps/ieee754/dbl-64/e_asin.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/sysdeps/ieee754/dbl-64/e_asin.c b/sysdeps/ieee754/dbl-64/e_asin.c
index d8c012d1d3..5d5fb01132 100644
--- a/sysdeps/ieee754/dbl-64/e_asin.c
+++ b/sysdeps/ieee754/dbl-64/e_asin.c
@@ -633,7 +633,7 @@ __ieee754_acos(double x)
   else
   if (k==0x3ff00000 && u.i[LOW_HALF]==0) return (m>0)?0:2.0*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;