Updated negate() method to allow for denominator or numerator being negative.