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
@@ -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);
|
||||
}
|
||||
|
Reference in New Issue
Block a user