operator * method

Rational operator *(
  1. Rational other
)

Multiplies this Rational with other.

const Rational(2, 3) * const Rational(4, 3) == const Rational(8, 9)
const Rational(4, 5) * const Rational(-2, 3) == const Rational(-8, 15)

Implementation

Rational operator *(Rational other) => Rational(
      _numerator * other._numerator,
      _denominator * other._denominator,
    );