summary refs log tree commit diff
path: root/sysdeps/libm-ieee754/s_log2.c
diff options
context:
space:
mode:
Diffstat (limited to 'sysdeps/libm-ieee754/s_log2.c')
-rw-r--r--sysdeps/libm-ieee754/s_log2.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sysdeps/libm-ieee754/s_log2.c b/sysdeps/libm-ieee754/s_log2.c
index 46b53cfeff..93c20b3db1 100644
--- a/sysdeps/libm-ieee754/s_log2.c
+++ b/sysdeps/libm-ieee754/s_log2.c
@@ -93,8 +93,8 @@ static double zero   =  0.0;
 	k=0;
 	if (hx < 0x00100000) {			/* x < 2**-1022  */
 	    if (((hx&0x7fffffff)|lx)==0)
-		return -two54/zero;		/* log(+-0)=-inf */
-	    if (hx<0) return (x-x)/zero;	/* log(-#) = NaN */
+		return -two54/(x-x);		/* log(+-0)=-inf */
+	    if (hx<0) return (x-x)/(x-x);	/* log(-#) = NaN */
 	    k -= 54; x *= two54; /* subnormal number, scale up x */
 	    GET_HIGH_WORD(hx,x);
 	}