1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-04 12:00:25 +00:00

Add is_finite method for checking built-in types

This commit is contained in:
Haoyu Qiu
2022-08-11 16:12:27 +08:00
parent 18177828ad
commit 5da515773d
46 changed files with 504 additions and 12 deletions

View File

@@ -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; }