diff options
Diffstat (limited to 'src/math/acosf.c')
-rw-r--r-- | src/math/acosf.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/math/acosf.c b/src/math/acosf.c index dd3bba29..b4665d02 100644 --- a/src/math/acosf.c +++ b/src/math/acosf.c @@ -36,8 +36,8 @@ float acosf(float x) ix = hx & 0x7fffffff; if (ix >= 0x3f800000) { /* |x| >= 1 */ if (ix == 0x3f800000) { /* |x| == 1 */ - if(hx>0) return 0.0; /* acos(1) = 0 */ - return pi + (float)2.0*pio2_lo; /* acos(-1)= pi */ + if (hx > 0) return 0.0f; /* acos(1) = 0 */ + return pi + 2.0f*pio2_lo; /* acos(-1)= pi */ } return (x-x)/(x-x); /* acos(|x|>1) is NaN */ } @@ -50,17 +50,17 @@ float acosf(float x) r = p/q; return pio2_hi - (x - (pio2_lo-x*r)); } else if (hx < 0) { /* x < -0.5 */ - z = (one+x)*(float)0.5; + z = (one+x)*0.5f; p = z*(pS0+z*(pS1+z*pS2)); q = one+z*qS1; s = sqrtf(z); r = p/q; w = r*s-pio2_lo; - return pi - (float)2.0*(s+w); + return pi - 2.0f*(s+w); } else { /* x > 0.5 */ int32_t idf; - z = (one-x)*(float)0.5; + z = (one-x)*0.5f; s = sqrtf(z); df = s; GET_FLOAT_WORD(idf,df); @@ -70,6 +70,6 @@ float acosf(float x) q = one+z*qS1; r = p/q; w = r*s+c; - return (float)2.0*(df+w); + return 2.0f*(df+w); } } |