diff options
author | Jakub Jelinek <jakub@redhat.com> | 2005-07-08 09:10:42 +0000 |
---|---|---|
committer | Jakub Jelinek <jakub@redhat.com> | 2005-07-08 09:10:42 +0000 |
commit | 48f006fc656c70757103dc9efa92d5775717576b (patch) | |
tree | 49d57e1205b93471c3245fceab5dd5ac31ba743d /sysdeps/generic/s_ctan.c | |
parent | 03d65262fdcc287ef8b691c7dff2f1a63cdd13c2 (diff) | |
download | glibc-48f006fc656c70757103dc9efa92d5775717576b.tar glibc-48f006fc656c70757103dc9efa92d5775717576b.tar.gz glibc-48f006fc656c70757103dc9efa92d5775717576b.tar.bz2 glibc-48f006fc656c70757103dc9efa92d5775717576b.zip |
Updated to fedora-glibc-20050708T0811
Diffstat (limited to 'sysdeps/generic/s_ctan.c')
-rw-r--r-- | sysdeps/generic/s_ctan.c | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/sysdeps/generic/s_ctan.c b/sysdeps/generic/s_ctan.c index 6a09fe465b..0464ab86d5 100644 --- a/sysdeps/generic/s_ctan.c +++ b/sysdeps/generic/s_ctan.c @@ -1,5 +1,5 @@ /* Complex tangent function for double. - Copyright (C) 1997 Free Software Foundation, Inc. + Copyright (C) 1997, 2005 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997. @@ -61,8 +61,18 @@ __ctan (__complex__ double x) den = cos2rx + __ieee754_cosh (2.0 * __imag__ x); - __real__ res = sin2rx / den; - __imag__ res = __ieee754_sinh (2.0 * __imag__ x) / den; + if (den == 0.0) + { + __complex__ double ez = __cexp (1.0i * x); + __complex__ double emz = __cexp (-1.0i * x); + + res = (ez - emz) / (ez + emz) * -1.0i; + } + else + { + __real__ res = sin2rx / den; + __imag__ res = __ieee754_sinh (2.0 * __imag__ x) / den; + } } return res; |