diff options
author | Joseph Myers <joseph@codesourcery.com> | 2013-04-24 18:59:37 +0000 |
---|---|---|
committer | Joseph Myers <joseph@codesourcery.com> | 2013-04-24 18:59:37 +0000 |
commit | 77f143fdb4770278f90e8f64d673b7e84d84a99f (patch) | |
tree | 61a1918bf2cbd20de21dda3a34c5353bbdf47ed9 | |
parent | 2f38fbfe09e4856c571bf0c80844e5dac9bc77ec (diff) | |
download | glibc-77f143fdb4770278f90e8f64d673b7e84d84a99f.tar.gz glibc-77f143fdb4770278f90e8f64d673b7e84d84a99f.tar.xz glibc-77f143fdb4770278f90e8f64d673b7e84d84a99f.zip |
Use suffixed floating-point constants in float and long double catan/catanh.
-rw-r--r-- | ChangeLog | 6 | ||||
-rw-r--r-- | math/s_catanf.c | 14 | ||||
-rw-r--r-- | math/s_catanhf.c | 14 | ||||
-rw-r--r-- | math/s_catanhl.c | 14 | ||||
-rw-r--r-- | math/s_catanl.c | 14 |
5 files changed, 34 insertions, 28 deletions
diff --git a/ChangeLog b/ChangeLog index c3404acd82..bd97c4cdb1 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,11 @@ 2013-04-24 Joseph Myers <joseph@codesourcery.com> + * math/s_catanf.c (__catanf): Use suffixed floating-point + constants. + * math/s_catanhf.c (__catanhf): Likewise. + * math/s_catanhl.c (__catanhl): Likewise. + * math/s_catanl.c (__catanl): Likewise. + [BZ #15394] * math/s_catan.c (__catan): Calculate imaginary part of result with log1p not log unless computing log of number close to 0. diff --git a/math/s_catanf.c b/math/s_catanf.c index 0dc85ffc25..3ffc6db52c 100644 --- a/math/s_catanf.c +++ b/math/s_catanf.c @@ -67,21 +67,21 @@ __catanf (__complex__ float x) den = 1 - r2 - __imag__ x * __imag__ x; - __real__ res = 0.5 * __ieee754_atan2f (2.0 * __real__ x, den); + __real__ res = 0.5f * __ieee754_atan2f (2.0f * __real__ x, den); - num = __imag__ x + 1.0; + num = __imag__ x + 1.0f; num = r2 + num * num; - den = __imag__ x - 1.0; + den = __imag__ x - 1.0f; den = r2 + den * den; f = num / den; - if (f < 0.5) - __imag__ res = 0.25 * __ieee754_logf (f); + if (f < 0.5f) + __imag__ res = 0.25f * __ieee754_logf (f); else { - num = 4.0 * __imag__ x; - __imag__ res = 0.25 * __log1pf (num / den); + num = 4.0f * __imag__ x; + __imag__ res = 0.25f * __log1pf (num / den); } } diff --git a/math/s_catanhf.c b/math/s_catanhf.c index ca9a30101e..9d90a00c83 100644 --- a/math/s_catanhf.c +++ b/math/s_catanhf.c @@ -58,24 +58,24 @@ __catanhf (__complex__ float x) { float i2 = __imag__ x * __imag__ x; - float num = 1.0 + __real__ x; + float num = 1.0f + __real__ x; num = i2 + num * num; - float den = 1.0 - __real__ x; + float den = 1.0f - __real__ x; den = i2 + den * den; float f = num / den; - if (f < 0.5) - __real__ res = 0.25 * __ieee754_logf (f); + if (f < 0.5f) + __real__ res = 0.25f * __ieee754_logf (f); else { - num = 4.0 * __real__ x; - __real__ res = 0.25 * __log1pf (num / den); + num = 4.0f * __real__ x; + __real__ res = 0.25f * __log1pf (num / den); } den = 1 - __real__ x * __real__ x - i2; - __imag__ res = 0.5 * __ieee754_atan2f (2.0 * __imag__ x, den); + __imag__ res = 0.5f * __ieee754_atan2f (2.0f * __imag__ x, den); } return res; diff --git a/math/s_catanhl.c b/math/s_catanhl.c index 4897c0c871..7e2b894257 100644 --- a/math/s_catanhl.c +++ b/math/s_catanhl.c @@ -58,24 +58,24 @@ __catanhl (__complex__ long double x) { long double i2 = __imag__ x * __imag__ x; - long double num = 1.0 + __real__ x; + long double num = 1.0L + __real__ x; num = i2 + num * num; - long double den = 1.0 - __real__ x; + long double den = 1.0L - __real__ x; den = i2 + den * den; long double f = num / den; - if (f < 0.5) - __real__ res = 0.25 * __ieee754_logl (f); + if (f < 0.5L) + __real__ res = 0.25L * __ieee754_logl (f); else { - num = 4.0 * __real__ x; - __real__ res = 0.25 * __log1pl (num / den); + num = 4.0L * __real__ x; + __real__ res = 0.25L * __log1pl (num / den); } den = 1 - __real__ x * __real__ x - i2; - __imag__ res = 0.5 * __ieee754_atan2l (2.0 * __imag__ x, den); + __imag__ res = 0.5L * __ieee754_atan2l (2.0L * __imag__ x, den); } return res; diff --git a/math/s_catanl.c b/math/s_catanl.c index e04dba7387..67b6b52d1d 100644 --- a/math/s_catanl.c +++ b/math/s_catanl.c @@ -67,21 +67,21 @@ __catanl (__complex__ long double x) den = 1 - r2 - __imag__ x * __imag__ x; - __real__ res = 0.5 * __ieee754_atan2l (2.0 * __real__ x, den); + __real__ res = 0.5L * __ieee754_atan2l (2.0L * __real__ x, den); - num = __imag__ x + 1.0; + num = __imag__ x + 1.0L; num = r2 + num * num; - den = __imag__ x - 1.0; + den = __imag__ x - 1.0L; den = r2 + den * den; f = num / den; - if (f < 0.5) - __imag__ res = 0.25 * __ieee754_logl (f); + if (f < 0.5L) + __imag__ res = 0.25L * __ieee754_logl (f); else { - num = 4.0 * __imag__ x; - __imag__ res = 0.25 * __log1pl (num / den); + num = 4.0L * __imag__ x; + __imag__ res = 0.25L * __log1pl (num / den); } } |