negate method

Fraction negate()

The sign of the current object is changed and the result is returned in a new Fraction instance.

Implementation

Fraction negate() => Fraction(numerator * -1, denominator);