about summary refs log tree commit diff
path: root/src/math/log1pf.c
diff options
context:
space:
mode:
authorRich Felker <dalias@aerifal.cx>2012-03-19 22:07:43 -0400
committerRich Felker <dalias@aerifal.cx>2012-03-19 22:07:43 -0400
commit97721a5508415a2f10eb068e022093811c9ff8be (patch)
tree88e9ce153895ad949576fa7ce1eeee4b02286479 /src/math/log1pf.c
parentacb744921b73f5a73803e533e5e4a4896d164a26 (diff)
parent0cbb65479147ecdaa664e88cc2a5a925f3de502f (diff)
downloadmusl-97721a5508415a2f10eb068e022093811c9ff8be.tar.gz
musl-97721a5508415a2f10eb068e022093811c9ff8be.tar.xz
musl-97721a5508415a2f10eb068e022093811c9ff8be.zip
Merge remote branch 'nsz/master'
Diffstat (limited to 'src/math/log1pf.c')
-rw-r--r--src/math/log1pf.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/src/math/log1pf.c b/src/math/log1pf.c
index 75eeb371..39832d28 100644
--- a/src/math/log1pf.c
+++ b/src/math/log1pf.c
@@ -27,8 +27,6 @@ Lp5 = 1.8183572590e-01, /* 3E3A3325 */
 Lp6 = 1.5313838422e-01, /* 3E1CD04F */
 Lp7 = 1.4798198640e-01; /* 3E178897 */
 
-static const float zero = 0.0;
-
 float log1pf(float x)
 {
 	float hfsq,f,c,s,z,R,u;
@@ -41,12 +39,12 @@ float log1pf(float x)
 	if (hx < 0x3ed413d0) {  /* 1+x < sqrt(2)+  */
 		if (ax >= 0x3f800000) {  /* x <= -1.0 */
 			if (x == -1.0f)
-				return -two25/zero; /* log1p(-1)=+inf */
+				return -two25/0.0f; /* log1p(-1)=+inf */
 			return (x-x)/(x-x);         /* log1p(x<-1)=NaN */
 		}
 		if (ax < 0x38000000) {   /* |x| < 2**-15 */
 			/* raise inexact */
-			if (two25 + x > zero && ax < 0x33800000)  /* |x| < 2**-24 */
+			if (two25 + x > 0.0f && ax < 0x33800000)  /* |x| < 2**-24 */
 				return x;
 			return x - x*x*0.5f;
 		}
@@ -91,9 +89,9 @@ float log1pf(float x)
 	}
 	hfsq = 0.5f * f * f;
 	if (hu == 0) {  /* |f| < 2**-20 */
-		if (f == zero) {
+		if (f == 0.0f) {
 			if (k == 0)
-				return zero;
+				return 0.0f;
 			c += k*ln2_lo;
 			return k*ln2_hi+c;
 		}