strictEquals method

  1. @override
bool strictEquals(
  1. Decimal other
)
override

Strict equality check (including scale)

  • returns false if other is a Rational
  • returns true only if both value and scale are equal
  • returns false otherwise

Implementation

@override
bool strictEquals(Decimal other) {
  if (other is! Rational) {
    return false;
  }
  return _numerator == other._numerator && _denominator == other._denominator;
}