operator == method

  1. @override
bool operator ==(
  1. Object other
)
override

Equal to

Implementation

@override
operator ==(Object other) {
  Rational? rational = null;
  if (other is Decimal) {
    rational = other.toRational();
  } else if (other is Rational) {
    rational = other;
  } else {
    return false;
  }
  return this.compareTo(rational) == 0;
}