inverse method

Fraction inverse()

The numerator and the denominator of this object are swapped and returned in a new Fraction object.

Implementation

Fraction inverse() => Fraction(denominator, numerator);