operator * method

  1. @override
Decimal operator *(
  1. Decimal other
)
override

Multiplication

Implementation

@override
operator *(Decimal other) {
  final otherRational = other.toRational();

  final newNumerator = _numerator * otherRational._numerator;
  final newDenominator = _denominator * otherRational._denominator;
  return Decimal.fraction(newNumerator, newDenominator);
}