Simplified is_nan()

This commit is contained in:
Revar Desmera 2020-02-07 01:58:45 -08:00
parent ba032e2f4d
commit a78973187a
2 changed files with 2 additions and 6 deletions

View file

@ -78,11 +78,7 @@ function is_integer(n) = is_num(n) && n == round(n);
// is_nan(x);
// Description:
// Returns true if a given value `x` is nan, a floating point value representing "not a number".
// This test is far more complicated than it should be, because while arguable correct, the tests
// `is_num(nan)` and `nan==nan` both returns false.
function is_nan(x) =
!is_num(x) && !is_undef(x) && !is_string(x) &&
!is_list(x) && !(x<=INF) && is_undef(x[0]);
function is_nan(x) = (x!=x);

View file

@ -8,7 +8,7 @@
//////////////////////////////////////////////////////////////////////
BOSL_VERSION = [2,0,117];
BOSL_VERSION = [2,0,118];
// Section: BOSL Library Version Functions