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 within epsilon of other. 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 within epsilon of other, returns other, otherwise returns this double.