mirror of
https://sourceware.org/git/glibc.git
synced 2024-12-13 23:00:22 +00:00
(__cproj): Fix bug: NaN + i NaN returns now NaN + i NaN.
This commit is contained in:
parent
23402ab9b6
commit
77a9b86190
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user