about summary refs log tree commit diff
path: root/sysdeps/ieee754
diff options
context:
space:
mode:
authorStefan Liebler <stli@linux.vnet.ibm.com>2014-04-29 15:43:36 +0200
committerAndreas Krebbel <krebbel@linux.vnet.ibm.com>2014-04-29 15:43:36 +0200
commit2ca180e97a16f3ee3ec9e7e5a5fb7eda3d863a02 (patch)
tree4b1d6f28281ad75b3abe35ee09684e1aae943012 /sysdeps/ieee754
parentdc041bd4dbaf0f22b962647e0d0a1b8090d0e679 (diff)
downloadglibc-2ca180e97a16f3ee3ec9e7e5a5fb7eda3d863a02.tar.gz
glibc-2ca180e97a16f3ee3ec9e7e5a5fb7eda3d863a02.tar.xz
glibc-2ca180e97a16f3ee3ec9e7e5a5fb7eda3d863a02.zip
[BZ #16823] Fix log1pl returning wrong infinity sign
Diffstat (limited to 'sysdeps/ieee754')
-rw-r--r--sysdeps/ieee754/dbl-64/s_log1p.c2
-rw-r--r--sysdeps/ieee754/flt-32/s_log1pf.c2
-rw-r--r--sysdeps/ieee754/ldbl-128/s_log1pl.c2
3 files changed, 3 insertions, 3 deletions
diff --git a/sysdeps/ieee754/dbl-64/s_log1p.c b/sysdeps/ieee754/dbl-64/s_log1p.c
index fd4dce5f23..c922148937 100644
--- a/sysdeps/ieee754/dbl-64/s_log1p.c
+++ b/sysdeps/ieee754/dbl-64/s_log1p.c
@@ -110,7 +110,7 @@ __log1p (double x)
       if (__glibc_unlikely (ax >= 0x3ff00000))           /* x <= -1.0 */
 	{
 	  if (x == -1.0)
-	    return -two54 / (x - x);            /* log1p(-1)=+inf */
+	    return -two54 / zero;               /* log1p(-1)=-inf */
 	  else
 	    return (x - x) / (x - x);           /* log1p(x<-1)=NaN */
 	}
diff --git a/sysdeps/ieee754/flt-32/s_log1pf.c b/sysdeps/ieee754/flt-32/s_log1pf.c
index 0307277106..5f00febc04 100644
--- a/sysdeps/ieee754/flt-32/s_log1pf.c
+++ b/sysdeps/ieee754/flt-32/s_log1pf.c
@@ -42,7 +42,7 @@ __log1pf(float x)
 	k = 1;
 	if (hx < 0x3ed413d7) {			/* x < 0.41422  */
 	    if(ax>=0x3f800000) {		/* x <= -1.0 */
-		if(x==(float)-1.0) return -two25/(x-x); /* log1p(-1)=+inf */
+		if(x==(float)-1.0) return -two25/zero; /* log1p(-1)=-inf */
 		else return (x-x)/(x-x);	/* log1p(x<-1)=NaN */
 	    }
 	    if(ax<0x31000000) {			/* |x| < 2**-29 */
diff --git a/sysdeps/ieee754/ldbl-128/s_log1pl.c b/sysdeps/ieee754/ldbl-128/s_log1pl.c
index d991e8a720..d8d89f0a8c 100644
--- a/sysdeps/ieee754/ldbl-128/s_log1pl.c
+++ b/sysdeps/ieee754/ldbl-128/s_log1pl.c
@@ -150,7 +150,7 @@ __log1pl (long double xm1)
   if (x <= 0.0L)
     {
       if (x == 0.0L)
-	return (-1.0L / (x - x));
+	return (-1.0L / zero);  /* log1p(-1) = -inf */
       else
 	return (zero / (x - x));
     }