diff --git a/src/lib/mathlib/math/Functions.hpp b/src/lib/mathlib/math/Functions.hpp index 14dcd5f169..0cc394547a 100644 --- a/src/lib/mathlib/math/Functions.hpp +++ b/src/lib/mathlib/math/Functions.hpp @@ -48,7 +48,7 @@ namespace math template int sign(T val) { - return (T(0) < val) - (val < T(0)); + return (T(FLT_EPSILON) < val) - (val < T(FLT_EPSILON)); } // Type-safe signum function with zero treated as positive