Changed: Implement a TODO

--HG--
branch : develop
hg/feature/material-editor
kervala 9 years ago
parent a9af8f4efe
commit 45597ebd8a

@ -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<double>::epsilon();
}

Loading…
Cancel
Save