From 0cbb65479147ecdaa664e88cc2a5a925f3de502f Mon Sep 17 00:00:00 2001 From: nsz Date: Mon, 19 Mar 2012 23:41:19 +0100 Subject: 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). --- src/math/atanf.c | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) (limited to 'src/math/atanf.c') diff --git a/src/math/atanf.c b/src/math/atanf.c index 73cebb5e..4e31b902 100644 --- a/src/math/atanf.c +++ b/src/math/atanf.c @@ -38,9 +38,7 @@ static const float aT[] = { 6.1687607318e-02, }; -static const float -one = 1.0, -huge = 1.0e30; +static const float huge = 1.0e30; float atanf(float x) { @@ -60,7 +58,7 @@ float atanf(float x) if (ix < 0x3ee00000) { /* |x| < 0.4375 */ if (ix < 0x39800000) { /* |x| < 2**-12 */ /* raise inexact */ - if(huge+x>one) + if(huge+x>1.0f) return x; } id = -1; @@ -69,15 +67,15 @@ float atanf(float x) if (ix < 0x3f980000) { /* |x| < 1.1875 */ if (ix < 0x3f300000) { /* 7/16 <= |x| < 11/16 */ id = 0; - x = (2.0f*x - one)/(2.0f + x); + x = (2.0f*x - 1.0f)/(2.0f + x); } else { /* 11/16 <= |x| < 19/16 */ id = 1; - x = (x - one)/(x + one); + x = (x - 1.0f)/(x + 1.0f); } } else { if (ix < 0x401c0000) { /* |x| < 2.4375 */ id = 2; - x = (x - 1.5f)/(one + 1.5f*x); + x = (x - 1.5f)/(1.0f + 1.5f*x); } else { /* 2.4375 <= |x| < 2**26 */ id = 3; x = -1.0f/x; -- cgit v1.2.1