mirror of
https://port.numenaute.org/aleajactaest/khanat-code-old.git
synced 2024-12-05 01:34:48 +00:00
Changed: Implement a TODO
This commit is contained in:
parent
6dbbb2b714
commit
1a7b86f6fb
1 changed files with 4 additions and 5 deletions
|
@ -856,11 +856,10 @@ bool CObjectNumber::equal(const CObject* other) const
|
||||||
//H_AUTO(R2_CObjectNumber_equal)
|
//H_AUTO(R2_CObjectNumber_equal)
|
||||||
if (!other || !other->isNumber()) return false;
|
if (!other || !other->isNumber()) return false;
|
||||||
double otherValue = other->toNumber();
|
double otherValue = other->toNumber();
|
||||||
if (_Value == otherValue ) return true;
|
if (_Value == otherValue) return true;
|
||||||
/*
|
|
||||||
TODO: fabs + epsilon trick
|
// if difference between 2 values less than epsilon, we consider they are equals
|
||||||
*/
|
return fabs(_Value - otherValue) <= std::numeric_limits<double>::epsilon();
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue