pow method

Rational pow(
  1. int exponent
)

Returns this to the power of exponent.

Returns one if the exponent equals 0.

The exponent must otherwise be positive.

Implementation

Rational pow(int exponent) =>
    Rational(numerator.pow(exponent), denominator.pow(exponent));