From ddca407f68e3b2e1e7b5625aeefe9a8e4234f588 Mon Sep 17 00:00:00 2001 From: kervala Date: Sat, 14 Nov 2015 18:21:44 +0100 Subject: [PATCH] Changed: Implement a TODO --- code/ryzom/common/src/game_share/object.cpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/code/ryzom/common/src/game_share/object.cpp b/code/ryzom/common/src/game_share/object.cpp index a89245ad1..0505a8b35 100644 --- a/code/ryzom/common/src/game_share/object.cpp +++ b/code/ryzom/common/src/game_share/object.cpp @@ -856,11 +856,10 @@ bool CObjectNumber::equal(const CObject* other) const //H_AUTO(R2_CObjectNumber_equal) if (!other || !other->isNumber()) return false; double otherValue = other->toNumber(); - if (_Value == otherValue ) return true; - /* - TODO: fabs + epsilon trick - */ - return false; + if (_Value == otherValue) return true; + + // if difference between 2 values less than epsilon, we consider they are equals + return fabs(_Value - otherValue) <= std::numeric_limits::epsilon(); }