about summary refs log tree commit diff
path: root/sysdeps/ieee754
diff options
context:
space:
mode:
authorJoseph Myers <joseph@codesourcery.com>2016-06-09 17:23:51 +0000
committerJoseph Myers <joseph@codesourcery.com>2016-06-09 17:23:51 +0000
commit59e53a78985be92134f126c5597d15a9998001d1 (patch)
tree90b32cf3b481dcc889a41c3ade938dbd5e7868c4 /sysdeps/ieee754
parentac187dc4abde9ca6504c646106e2a7f7b2806262 (diff)
downloadglibc-59e53a78985be92134f126c5597d15a9998001d1.tar.gz
glibc-59e53a78985be92134f126c5597d15a9998001d1.tar.xz
glibc-59e53a78985be92134f126c5597d15a9998001d1.zip
Fix ldbl-128 expm1l (sNaN) (bug 20232).
The ldbl-128 version of expm1l returns sNaN for sNaN input.  This
patch fixes it to add such inputs to themselves so that qNaN is
returned in this case.

Tested for mips64.

	[BZ #20232]
	* sysdeps/ieee754/ldbl-128/s_expm1l.c (__expm1l): Add NaN input to
	itself.
Diffstat (limited to 'sysdeps/ieee754')
-rw-r--r--sysdeps/ieee754/ldbl-128/s_expm1l.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sysdeps/ieee754/ldbl-128/s_expm1l.c b/sysdeps/ieee754/ldbl-128/s_expm1l.c
index b1100a9d0e..da902efafd 100644
--- a/sysdeps/ieee754/ldbl-128/s_expm1l.c
+++ b/sysdeps/ieee754/ldbl-128/s_expm1l.c
@@ -111,8 +111,8 @@ __expm1l (long double x)
       /* Infinity (which must be negative infinity). */
       if (((ix & 0xffff) | u.parts32.w1 | u.parts32.w2 | u.parts32.w3) == 0)
 	return -1.0L;
-      /* NaN. No invalid exception. */
-      return x;
+      /* NaN.  Invalid exception if signaling.  */
+      return x + x;
     }
 
   /* expm1(+- 0) = +- 0.  */