Browse Source

mathlib - Add FLT_EPSILON deadzone in sign computation

sbg
bresch 6 years ago committed by Mathieu Bresciani
parent
commit
59f54a7fd8
  1. 2
      src/lib/mathlib/math/Functions.hpp

2
src/lib/mathlib/math/Functions.hpp

@ -48,7 +48,7 @@ namespace math @@ -48,7 +48,7 @@ namespace math
template<typename T>
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

Loading…
Cancel
Save