aboutsummaryrefslogtreecommitdiff
path: root/math/s_ctanf.c
diff options
context:
space:
mode:
Diffstat (limited to 'math/s_ctanf.c')
-rw-r--r--math/s_ctanf.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/math/s_ctanf.c b/math/s_ctanf.c
index 683ab6e544..d87f775f23 100644
--- a/math/s_ctanf.c
+++ b/math/s_ctanf.c
@@ -32,7 +32,14 @@ __ctanf (__complex__ float x)
{
if (__isinf_nsf (__imag__ x))
{
- __real__ res = __copysignf (0.0, __real__ x);
+ if (isfinite (__real__ x) && fabsf (__real__ x) > 1.0f)
+ {
+ float sinrx, cosrx;
+ __sincosf (__real__ x, &sinrx, &cosrx);
+ __real__ res = __copysignf (0.0f, sinrx * cosrx);
+ }
+ else
+ __real__ res = __copysignf (0.0, __real__ x);
__imag__ res = __copysignf (1.0, __imag__ x);
}
else if (__real__ x == 0.0)