about summary refs log tree commit diff
path: root/src/math/__cos.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/__cos.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/__cos.c')
-rw-r--r--src/math/__cos.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/math/__cos.c b/src/math/__cos.c
index ba439857..8699c1d5 100644
--- a/src/math/__cos.c
+++ b/src/math/__cos.c
@@ -51,7 +51,6 @@
 #include "libm.h"
 
 static const double
-one =  1.00000000000000000000e+00, /* 0x3FF00000, 0x00000000 */
 C1  =  4.16666666666666019037e-02, /* 0x3FA55555, 0x5555554C */
 C2  = -1.38888888888741095749e-03, /* 0xBF56C16C, 0x16C15177 */
 C3  =  2.48015872894767294178e-05, /* 0x3EFA01A0, 0x19CB1590 */
@@ -67,6 +66,6 @@ double __cos(double x, double y)
 	w  = z*z;
 	r  = z*(C1+z*(C2+z*C3)) + w*w*(C4+z*(C5+z*C6));
 	hz = 0.5*z;
-	w  = one-hz;
-	return w + (((one-w)-hz) + (z*r-x*y));
+	w  = 1.0-hz;
+	return w + (((1.0-w)-hz) + (z*r-x*y));
 }