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:
committed by
Corinna Vinschen
parent
8dee6fe6a5
commit
f7f296b46f
@@ -50,7 +50,12 @@ __FLT_TYPE
|
||||
__FLT_ABI(acosh) (__FLT_TYPE x)
|
||||
{
|
||||
int x_class = fpclassify (x);
|
||||
if (x_class == FP_NAN || x < __FLT_CST(1.0))
|
||||
if (x_class == FP_NAN)
|
||||
{
|
||||
errno = EDOM;
|
||||
return x;
|
||||
}
|
||||
else if (x < __FLT_CST(1.0))
|
||||
{
|
||||
errno = EDOM;
|
||||
return __FLT_NAN;
|
||||
|
Reference in New Issue
Block a user