mirror of
https://github.com/revarbat/BOSL2.git
synced 2025-01-16 13:50:23 +01:00
Simplified is_nan()
This commit is contained in:
parent
ba032e2f4d
commit
a78973187a
@ -78,11 +78,7 @@ function is_integer(n) = is_num(n) && n == round(n);
|
|||||||
// is_nan(x);
|
// is_nan(x);
|
||||||
// Description:
|
// Description:
|
||||||
// Returns true if a given value `x` is nan, a floating point value representing "not a number".
|
// 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
|
function is_nan(x) = (x!=x);
|
||||||
// `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]);
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
//////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
|
||||||
BOSL_VERSION = [2,0,117];
|
BOSL_VERSION = [2,0,118];
|
||||||
|
|
||||||
|
|
||||||
// Section: BOSL Library Version Functions
|
// Section: BOSL Library Version Functions
|
||||||
|
Loading…
x
Reference in New Issue
Block a user