You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Commit 8bc322e adds a preprocessor guard that looks like it would cause the isnan function from math.h to be preferred, but doesn't actually do that on many platforms, e.g. glibc:
@jwesthues I'm not really sure what's the intent here--is it to check for NaN and infinity, or is it really a comparison with VERY_POSITIVE and VERY_NEGATIVE? Regardless, we need a better name for the function that doesn't clash with math.h, and to get rid of the misleading preprocessor junk.
The text was updated successfully, but these errors were encountered:
Yeah, clearly not good. This is used for stuff like testing whether numerical algorithms converged to anything reasonable, so actual standard isnan() is definitely not what we want--we definitely want to return true for ±Inf, and for implausibly large or small normal numbers too. I'd keep the definition but rename, to IsReasonable() or something.
Commit ea6db67 added an unusual isnan macro:
#define isnan(x) (((x) != (x)) || (x > 1e11) || (x < -1e11))
Commit 8bc322e adds a preprocessor guard that looks like it would
cause the isnan function from math.h to be preferred, but doesn't
actually do that on many platforms, e.g. glibc:
#ifndef isnan
# define isnan(x) (((x) != (x)) || (x > 1e11) || (x < -1e11))
#endif
This commit renames our isnan() to make it clear that it differs
from the standard library operation, and makes it a function.
Fixes#603.
Commit ea6db67 added an unusual
isnan
macro:Commit 8bc322e adds a preprocessor guard that looks like it would cause the
isnan
function frommath.h
to be preferred, but doesn't actually do that on many platforms, e.g. glibc:@jwesthues I'm not really sure what's the intent here--is it to check for NaN and infinity, or is it really a comparison with
VERY_POSITIVE
andVERY_NEGATIVE
? Regardless, we need a better name for the function that doesn't clash withmath.h
, and to get rid of the misleading preprocessor junk.The text was updated successfully, but these errors were encountered: