From: Ulrich Drepper Date: Tue, 19 Oct 1999 03:32:17 +0000 (+0000) Subject: (__cprojl): Fix bug: NaN + i NaN returns now NaN + i NaN. X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=91c4d9d89f1eff92b51acdcd04389aa8b658f6a1;p=thirdparty%2Fglibc.git (__cprojl): Fix bug: NaN + i NaN returns now NaN + i NaN. --- diff --git a/sysdeps/libm-ieee754/s_cprojl.c b/sysdeps/libm-ieee754/s_cprojl.c index 13da4b417d8..cac04079261 100644 --- a/sysdeps/libm-ieee754/s_cprojl.c +++ b/sysdeps/libm-ieee754/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 , 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);