]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
Fix ldbl-128ibm log1pl (sNaN) (bug 20234).
authorJoseph Myers <joseph@codesourcery.com>
Thu, 9 Jun 2016 17:25:54 +0000 (17:25 +0000)
committerJoseph Myers <joseph@codesourcery.com>
Thu, 9 Jun 2016 17:25:54 +0000 (17:25 +0000)
The ldbl-128ibm version of log1pl 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 #20234]
* sysdeps/ieee754/ldbl-128ibm/s_log1pl.c (__log1pl): Add positive
infinity or NaN input to itself.

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

index 6944ac57ec62bb8c45829cd2c31bb77b049c3691..81192ce5b847ebef6b5dfcf77039dbf5ee98e4fe 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,9 @@
 2016-06-09  Joseph Myers  <joseph@codesourcery.com>
 
+       [BZ #20234]
+       * sysdeps/ieee754/ldbl-128ibm/s_log1pl.c (__log1pl): Add positive
+       infinity or NaN input to itself.
+
        [BZ #20233]
        * sysdeps/ieee754/ldbl-128ibm/s_expm1l.c (__expm1l): Add NaN input
        to itself.
index 743693bfd6429c7c688b11e41990779719bc9fdb..5457892a984f0345f403f499d474250d8c368d91 100644 (file)
@@ -132,7 +132,7 @@ __log1pl (long double xm1)
   xhi = ldbl_high (xm1);
   EXTRACT_WORDS (hx, lx, xhi);
   if (hx >= 0x7ff00000)
-    return xm1;
+    return xm1 + xm1;
 
   /* log1p(+- 0) = +- 0.  */
   if (((hx & 0x7fffffff) | lx) == 0)