DoubleCheck extension
- on
Methods
-
isCloseTo(
double other, {double epsilon = _defaultEpsilon}) → bool -
Available on double, provided by the DoubleCheck extension
Returns true if this double is withinepsilonofother. Useful for comparing doubles that may have been subject to rounding errors. -
roundToIfCloseTo(
double other, {double epsilon = _defaultEpsilon}) → double -
Available on double, provided by the DoubleCheck extension
If the double is withinepsilonofother, returnsother, otherwise returns this double.