Fix ldbl-128 expm1l (sNaN) (bug 20232) [committed]

Joseph Myers joseph@codesourcery.com
Thu Jun 9 17:24:00 GMT 2016


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.  Committed.

2016-06-09  Joseph Myers  <joseph@codesourcery.com>

	[BZ #20232]
	* sysdeps/ieee754/ldbl-128/s_expm1l.c (__expm1l): Add NaN input to
	itself.

diff --git a/sysdeps/ieee754/ldbl-128/s_expm1l.c b/sysdeps/ieee754/ldbl-128/s_expm1l.c
index b1100a9..da902ef 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.  */

-- 
Joseph S. Myers
joseph@codesourcery.com



More information about the Libc-alpha mailing list