operator / method

Rational operator /(
  1. Rational other
)

Divides this Rational with other.

const Rational(2, 3) / const Rational(4, 3) == const Rational(1, 2)
const Rational(4, 5) / const Rational(-2, 3) == const Rational(-6, 5)

Implementation

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