From 59f54a7fd83534ee2586ae72cb9788a2c38949df Mon Sep 17 00:00:00 2001 From: bresch Date: Thu, 5 Sep 2019 13:53:38 +0200 Subject: [PATCH] mathlib - Add FLT_EPSILON deadzone in sign computation --- src/lib/mathlib/math/Functions.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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