Cygwin: math: Properly propagate input NANs in a few functions

While the C99 standard doesn't explicitly require this, the standard
says it is recommended (F.9.13).

Signed-off-by: Martin Storsjö <martin@martin.st>
This commit is contained in:
Martin Storsjö
2019-07-25 00:13:13 +03:00
committed by Corinna Vinschen
parent 8dee6fe6a5
commit f7f296b46f
6 changed files with 20 additions and 8 deletions

View File

@@ -121,9 +121,13 @@ __FLT_ABI(pow) (__FLT_TYPE x, __FLT_TYPE y)
return __FLT_CST(1.0);
else if (x_class == FP_NAN || y_class == FP_NAN)
{
rslt = (signbit(x) ? -__FLT_NAN : __FLT_NAN);
errno = EDOM;
return rslt;
if (x_class == FP_NAN) {
errno = EDOM;
return x;
} else {
errno = EDOM;
return y;
}
}
else if (x_class == FP_ZERO)
{