summaryrefslogtreecommitdiffstats
path: root/core/math/math_funcs.h
diff options
context:
space:
mode:
authorHaoyu Qiu <timothyqiu32@gmail.com>2022-08-11 16:12:27 +0800
committerHaoyu Qiu <timothyqiu32@gmail.com>2022-10-08 13:25:08 +0800
commit5da515773d8edec988b7523ea97cdfd54c3fd16c (patch)
tree1107edc8f9bcff011b9bf789cf0e54bc9d46c28d /core/math/math_funcs.h
parent18177828ad97286ca88cbdcfb763c967858d051b (diff)
downloadredot-engine-5da515773d8edec988b7523ea97cdfd54c3fd16c.tar.gz
Add `is_finite` method for checking built-in types
Diffstat (limited to 'core/math/math_funcs.h')
-rw-r--r--core/math/math_funcs.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/core/math/math_funcs.h b/core/math/math_funcs.h
index 7fa674a23d..0af529ad98 100644
--- a/core/math/math_funcs.h
+++ b/core/math/math_funcs.h
@@ -184,6 +184,9 @@ public:
#endif
}
+ static _ALWAYS_INLINE_ bool is_finite(double p_val) { return isfinite(p_val); }
+ static _ALWAYS_INLINE_ bool is_finite(float p_val) { return isfinite(p_val); }
+
static _ALWAYS_INLINE_ double abs(double g) { return absd(g); }
static _ALWAYS_INLINE_ float abs(float g) { return absf(g); }
static _ALWAYS_INLINE_ int abs(int g) { return g > 0 ? g : -g; }