Function necsim::doubleCompare(long double, long double, long double)¶
- Defined in File double_comparison.cpp
Function Documentation¶
-
bool
necsim
::
doubleCompare
(long double d1, long double d2, long double epsilon) Compares two doubles and returns a boolean of whether they are equal, within the epsilon deviation. This is useful for floating point errors in saving and reading doubles from file. Overloaded version for long doubles.
- Return
- true if the doubles are within epsilon of each other
- Parameters
d1
: the first double.d2
: the second double.epsilon
: the deviation within which the values are assumed to be equal.