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

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

index f72f22e2df6a627a3595742e879d0688e3c317fd..2d88f74d6b709cf13f701931802edba4fa4815ae 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2016-06-09  Joseph Myers  <joseph@codesourcery.com>
+
+       [BZ #20232]
+       * sysdeps/ieee754/ldbl-128/s_expm1l.c (__expm1l): Add NaN input to
+       itself.
+
 2016-06-09  H.J. Lu  <hongjiu.lu@intel.com>
 
        * sysdeps/x86_64/start.S (_start): Always indirect branch to
index b1100a9d0e24bf220c9ad2e937788af6c3517ad4..da902efafd66f4a83f041e42bae9a10b4e0c0d94 100644 (file)
@@ -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.  */