[Math] Add is_finite methods

(cherry picked from commit d389171905)
This commit is contained in:
A Thousand Ships
2024-04-10 21:18:46 +02:00
committed by David Snopek
parent 8f8ea90088
commit 3d814f6e87
21 changed files with 58 additions and 0 deletions

View File

@@ -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) {