operator - method

Fraction operator -(
  1. Object other
)

Returns the difference of this fraction and other.

Implementation

Fraction operator -(Object other) {
  if (other is Fraction) {
    return Fraction(a * other.b - other.a * b, b * other.b);
  } else if (other is int) {
    return Fraction(a - other * b, b);
  } else {
    throw ArgumentError.value(other, 'other', 'Invalid type');
  }
}