From a78973187a9ae9bffb65b809defbc58ce428aecd Mon Sep 17 00:00:00 2001 From: Revar Desmera Date: Fri, 7 Feb 2020 01:58:45 -0800 Subject: [PATCH] Simplified is_nan() --- common.scad | 6 +----- version.scad | 2 +- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/common.scad b/common.scad index a888cc8..7e03189 100644 --- a/common.scad +++ b/common.scad @@ -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); diff --git a/version.scad b/version.scad index e67f65e..ffa5a4f 100644 --- a/version.scad +++ b/version.scad @@ -8,7 +8,7 @@ ////////////////////////////////////////////////////////////////////// -BOSL_VERSION = [2,0,117]; +BOSL_VERSION = [2,0,118]; // Section: BOSL Library Version Functions