fix logical bug at subtract instance method
This commit is contained in:
@@ -53,7 +53,7 @@ public class Rational {
|
||||
|
||||
// COMPLETED - Instance method - this - other
|
||||
public Rational subtract(Rational other) {
|
||||
int newNumerator = (this.numerator * other.denominator - other.denominator * this.denominator);
|
||||
int newNumerator = (this.numerator * other.denominator - other.numerator * this.denominator);
|
||||
int newDenominator = this.denominator * other.denominator;
|
||||
|
||||
Rational result = new Rational(newNumerator, newDenominator);
|
||||
|
||||
Reference in New Issue
Block a user