RationalToleranceExtension extension

Extension on Rational to support isWithinTolerance and isCloseTo

on
  • Rational

Methods

isCloseTo(Rational other, {Rational? relativeTolerance, Rational? absoluteTolerance}) bool

Available on Rational, provided by the RationalToleranceExtension extension

Checks if this Rational is close to other within the specified tolerances.
isWithinTolerance(Rational target, Rational tolerance) bool

Available on Rational, provided by the RationalToleranceExtension extension

Checks if this Rational is within a fixed tolerance of the target value.