]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
Fix ldbl-128ibm log1pl (-1) sign of infinity (bug 19076).
authorJoseph Myers <joseph@codesourcery.com>
Tue, 6 Oct 2015 15:14:26 +0000 (15:14 +0000)
committerJoseph Myers <joseph@codesourcery.com>
Tue, 6 Oct 2015 15:14:26 +0000 (15:14 +0000)
The ldbl-128ibm implementation of log1pl produces an infinity with the
wrong sign for log1pl (-1) in FE_DOWNWARD mode.  This patch fixes this
by changing a division (-1.0L / (x - x)) (incorrect in FE_DOWNWARD
mode) to (-1.0L / 0.0L) (correct in all rounding modes).

Tested for powerpc.

[BZ #19076]
* sysdeps/ieee754/ldbl-128ibm/s_log1pl.c (__log1pl): Divide by
constant 0.0L when computing infinite result.

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

index 6cb9b73dc60986961e1b6d0c3e94b3266b41dd62..17388a7927868819dd0092e32271917fe76dc0b4 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2015-10-06  Joseph Myers  <joseph@codesourcery.com>
+
+       [BZ #19076]
+       * sysdeps/ieee754/ldbl-128ibm/s_log1pl.c (__log1pl): Divide by
+       constant 0.0L when computing infinite result.
+
 2015-10-06  Florian Weimer  <fweimer@redhat.com>
 
        [BZ #10432]
diff --git a/NEWS b/NEWS
index 3852e7f3e1f3cc8213640c386894dd7479b7250d..b93a5dc4e96d3712d7defe98778f2a0b79fdb9c4 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -18,7 +18,7 @@ Version 2.23
   18820, 18823, 18824, 18825, 18857, 18863, 18870, 18872, 18873, 18875,
   18887, 18921, 18951, 18952, 18956, 18961, 18966, 18967, 18969, 18970,
   18977, 18980, 18981, 18985, 19003, 19012, 19016, 19018, 19032, 19046,
-  19049, 19050, 19059, 19071.
+  19049, 19050, 19059, 19071, 19076.
 
 * The obsolete header <regexp.h> has been removed.  Programs that require
   this header must be updated to use <regex.h> instead.
index a0e24d7f2205b7697e098640c7b03d6d1db04534..ad9a1fe20f4a7874b0f5fe75ee99b5958b823788 100644 (file)
@@ -149,7 +149,7 @@ __log1pl (long double xm1)
   if (x <= 0.0L)
     {
       if (x == 0.0L)
-       return (-1.0L / (x - x));
+       return (-1.0L / 0.0L);
       else
        return (zero / (x - x));
     }