1
0
mirror of https://sourceware.org/git/glibc.git synced 2025-08-01 10:06:57 +03:00

Fix cexp (NaN + i0) (bug 15532).

This commit is contained in:
Joseph Myers
2013-08-23 19:45:38 +00:00
parent 936241e4b2
commit 8fe89494e6
6 changed files with 42 additions and 14 deletions

View File

@ -145,12 +145,18 @@ __cexpf (__complex__ float x)
}
else
{
/* If the real part is NaN the result is NaN + iNaN. */
/* If the real part is NaN the result is NaN + iNaN unless the
imaginary part is zero. */
__real__ retval = __nanf ("");
__imag__ retval = __nanf ("");
if (icls == FP_ZERO)
__imag__ retval = __imag__ x;
else
{
__imag__ retval = __nanf ("");
if (rcls != FP_NAN || icls != FP_NAN)
feraiseexcept (FE_INVALID);
if (rcls != FP_NAN || icls != FP_NAN)
feraiseexcept (FE_INVALID);
}
}
return retval;