about summary refs log tree commit diff
path: root/src/math/__rem_pio2_large.c
diff options
context:
space:
mode:
authornsz <nsz@port70.net>2012-03-19 23:41:19 +0100
committernsz <nsz@port70.net>2012-03-19 23:41:19 +0100
commit0cbb65479147ecdaa664e88cc2a5a925f3de502f (patch)
tree7b6dc53fcec6497d55746d3cc47f167a20b7aa57 /src/math/__rem_pio2_large.c
parentb03255af77776703c8d48819e824d09f6f54ba86 (diff)
downloadmusl-0cbb65479147ecdaa664e88cc2a5a925f3de502f.tar.gz
musl-0cbb65479147ecdaa664e88cc2a5a925f3de502f.tar.xz
musl-0cbb65479147ecdaa664e88cc2a5a925f3de502f.zip
code cleanup of named constants
zero, one, two, half are replaced by const literals
The policy was to use the f suffix for float consts (1.0f),
but don't use suffix for long double consts (these consts
can be exactly represented as double).
Diffstat (limited to 'src/math/__rem_pio2_large.c')
-rw-r--r--src/math/__rem_pio2_large.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/src/math/__rem_pio2_large.c b/src/math/__rem_pio2_large.c
index 35835f83..27b619cc 100644
--- a/src/math/__rem_pio2_large.c
+++ b/src/math/__rem_pio2_large.c
@@ -271,8 +271,6 @@ static const double PIo2[] = {
 };
 
 static const double
-zero   = 0.0,
-one    = 1.0,
 two24  = 1.67772160000000000000e+07, /* 0x41700000, 0x00000000 */
 twon24 = 5.96046447753906250000e-08; /* 0x3E700000, 0x00000000 */
 
@@ -293,7 +291,7 @@ int __rem_pio2_large(double *x, double *y, int e0, int nx, int prec)
 	/* set up f[0] to f[jx+jk] where f[jx+jk] = ipio2[jv+jk] */
 	j = jv-jx; m = jx+jk;
 	for (i=0; i<=m; i++,j++)
-		f[i] = j<0 ? zero : (double)ipio2[j];
+		f[i] = j<0 ? 0.0 : (double)ipio2[j];
 
 	/* compute q[0],q[1],...q[jk] */
 	for (i=0; i<=jk; i++) {
@@ -346,14 +344,14 @@ recompute:
 			}
 		}
 		if (ih == 2) {
-			z = one - z;
+			z = 1.0 - z;
 			if (carry != 0)
-				z -= scalbn(one,q0);
+				z -= scalbn(1.0,q0);
 		}
 	}
 
 	/* check if recomputation is needed */
-	if (z == zero) {
+	if (z == 0.0) {
 		j = 0;
 		for (i=jz-1; i>=jk; i--) j |= iq[i];
 		if (j == 0) {  /* need recomputation */
@@ -391,7 +389,7 @@ recompute:
 	}
 
 	/* convert integer "bit" chunk to floating-point value */
-	fw = scalbn(one,q0);
+	fw = scalbn(1.0,q0);
 	for (i=jz; i>=0; i--) {
 		q[i] = fw*(double)iq[i];
 		fw *= twon24;