]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
Fix ldbl-128ibm expm1l (sNaN) (bug 20233).
authorJoseph Myers <joseph@codesourcery.com>
Thu, 9 Jun 2016 17:24:52 +0000 (17:24 +0000)
committerJoseph Myers <joseph@codesourcery.com>
Thu, 9 Jun 2016 17:24:52 +0000 (17:24 +0000)
The ldbl-128ibm 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 powerpc.

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

ChangeLog
sysdeps/ieee754/ldbl-128ibm/s_expm1l.c

index 2d88f74d6b709cf13f701931802edba4fa4815ae..6944ac57ec62bb8c45829cd2c31bb77b049c3691 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,9 @@
 2016-06-09  Joseph Myers  <joseph@codesourcery.com>
 
+       [BZ #20233]
+       * sysdeps/ieee754/ldbl-128ibm/s_expm1l.c (__expm1l): Add NaN input
+       to itself.
+
        [BZ #20232]
        * sysdeps/ieee754/ldbl-128/s_expm1l.c (__expm1l): Add NaN input to
        itself.
index 66f75e1c80323e20194e18d2d1543606fdf61414..42d57c6eec2670214d2a60aaab1ab0349912846a 100644 (file)
@@ -106,8 +106,8 @@ __expm1l (long double x)
       /* Infinity (which must be negative infinity). */
       if (((ix - 0x7ff00000) | lx) == 0)
        return -1.0L;
-      /* NaN. No invalid exception. */
-      return x;
+      /* NaN.  Invalid exception if signaling.  */
+      return x + x;
     }
 
   /* expm1(+- 0) = +- 0.  */