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

@@ -56,6 +56,8 @@ __FLT_ABI(log) (__FLT_TYPE x)
errno = ERANGE;
return -__FLT_HUGE_VAL;
}
else if (x_class == FP_NAN)
return x;
else if (signbit (x))
{
errno = EDOM;
@@ -63,7 +65,5 @@ __FLT_ABI(log) (__FLT_TYPE x)
}
else if (x_class == FP_INFINITE)
return __FLT_HUGE_VAL;
else if (x_class == FP_NAN)
return __FLT_NAN;
return (__FLT_TYPE) __logl_internal ((long double) x);
}