inverse method

Fraction inverse()

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

Implementation

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