isApproximatelyEqual method

bool isApproximatelyEqual(
  1. num other, {
  2. double tolerance = 0.01,
})

Checks if this number is approximately equal to other within a tolerance.

Implementation

bool isApproximatelyEqual(num other, {double tolerance = 0.01}) {
  return (this - other).abs() <= tolerance;
}