diff options
Diffstat (limited to 'sysdeps/generic')
-rw-r--r-- | sysdeps/generic/s_cproj.c | 6 | ||||
-rw-r--r-- | sysdeps/generic/s_cprojf.c | 6 | ||||
-rw-r--r-- | sysdeps/generic/s_cprojl.c | 6 |
3 files changed, 12 insertions, 6 deletions
diff --git a/sysdeps/generic/s_cproj.c b/sysdeps/generic/s_cproj.c index fb50bb5a88..f126bbe055 100644 --- a/sysdeps/generic/s_cproj.c +++ b/sysdeps/generic/s_cproj.c @@ -1,5 +1,5 @@ /* Compute projection of complex double value to Riemann sphere. - Copyright (C) 1997 Free Software Foundation, Inc. + Copyright (C) 1997, 1999 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997. @@ -27,7 +27,9 @@ __cproj (__complex__ double x) { __complex__ double res; - if (!isfinite (__real__ x) || !isfinite (__imag__ x)) + if (isnan (__real__ x) && isnan (__imag__ x)) + return x; + else if (!isfinite (__real__ x) || !isfinite (__imag__ x)) { __real__ res = INFINITY; __imag__ res = __copysign (0.0, __imag__ x); diff --git a/sysdeps/generic/s_cprojf.c b/sysdeps/generic/s_cprojf.c index b90590835c..6ec8b66001 100644 --- a/sysdeps/generic/s_cprojf.c +++ b/sysdeps/generic/s_cprojf.c @@ -1,5 +1,5 @@ /* Compute projection of complex float value to Riemann sphere. - Copyright (C) 1997 Free Software Foundation, Inc. + Copyright (C) 1997, 1999 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997. @@ -27,7 +27,9 @@ __cprojf (__complex__ float x) { __complex__ float res; - if (!isfinite (__real__ x) || !isfinite (__imag__ x)) + if (isnan (__real__ x) && isnan (__imag__ x)) + return x; + else if (!isfinite (__real__ x) || !isfinite (__imag__ x)) { __real__ res = INFINITY; __imag__ res = __copysignf (0.0, __imag__ x); diff --git a/sysdeps/generic/s_cprojl.c b/sysdeps/generic/s_cprojl.c index 13da4b417d..cac0407926 100644 --- a/sysdeps/generic/s_cprojl.c +++ b/sysdeps/generic/s_cprojl.c @@ -1,5 +1,5 @@ /* Compute projection of complex long double value to Riemann sphere. - Copyright (C) 1997 Free Software Foundation, Inc. + Copyright (C) 1997, 1999 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997. @@ -27,7 +27,9 @@ __cprojl (__complex__ long double x) { __complex__ long double res; - if (!isfinite (__real__ x) || !isfinite (__imag__ x)) + if (isnan (__real__ x) && isnan (__imag__ x)) + return x; + else if (!isfinite (__real__ x) || !isfinite (__imag__ x)) { __real__ res = INFINITY; __imag__ res = __copysignl (0.0, __imag__ x); |