diff --git a/simgear/math/SGMisc.hxx b/simgear/math/SGMisc.hxx index 47e89f75..cd448b05 100644 --- a/simgear/math/SGMisc.hxx +++ b/simgear/math/SGMisc.hxx @@ -155,6 +155,12 @@ public: { return std::isnan(v); } + + static bool eq(const T& a, const T& b, const T& epsilon = SGLimits::epsilon()) + { return std::abs(a - b) < epsilon; } + + static bool neq(const T& a, const T& b, const T& epsilon = SGLimits::epsilon()) + { return !eq(a, b, epsilon); } }; #endif