diff options
| author | A Thousand Ships <96648715+AThousandShips@users.noreply.github.com> | 2024-04-10 21:18:46 +0200 |
|---|---|---|
| committer | A Thousand Ships <96648715+AThousandShips@users.noreply.github.com> | 2024-04-11 13:30:28 +0200 |
| commit | d38917190503b75b307654f54bf5b44c83d0aea4 (patch) | |
| tree | cc030315047d57665561607c0b1acb916f5b837c /include/godot_cpp/core | |
| parent | b02124595f46ec9bf35d6b0636c9bf16750fbfb6 (diff) | |
| download | redot-cpp-d38917190503b75b307654f54bf5b44c83d0aea4.tar.gz | |
[Math] Add `is_finite` methods
Diffstat (limited to 'include/godot_cpp/core')
| -rw-r--r-- | include/godot_cpp/core/math.hpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/include/godot_cpp/core/math.hpp b/include/godot_cpp/core/math.hpp index 2cbbe27..1949360 100644 --- a/include/godot_cpp/core/math.hpp +++ b/include/godot_cpp/core/math.hpp @@ -613,6 +613,14 @@ inline bool is_inf(double p_val) { return std::isinf(p_val); } +inline bool is_finite(float p_val) { + return std::isfinite(p_val); +} + +inline bool is_finite(double p_val) { + return std::isfinite(p_val); +} + inline bool is_equal_approx(float a, float b) { // Check for exact equality first, required to handle "infinity" values. if (a == b) { |
