operator * method
Returns the multiplication of this fraction and other
.
Implementation
Fraction operator *(Object other) {
if (other is Fraction) {
return Fraction(a * other.a, b * other.b);
} else if (other is int) {
return Fraction(a * other, b);
} else {
throw ArgumentError.value(other, 'other', 'Invalid type');
}
}