Skip to content

Commit

Permalink
fixed files form Math #91
Browse files Browse the repository at this point in the history
  • Loading branch information
tdurieux committed Mar 7, 2017
1 parent 8dd5bec commit d5b468a
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -256,8 +256,8 @@ public Fraction abs() {
* than <tt>object</tt>, 0 if they are equal.
*/
public int compareTo(Fraction object) {
double nOd = doubleValue();
double dOn = object.doubleValue();
long nOd = ((long) numerator) * object.denominator;
long dOn = ((long) denominator) * object.numerator;
return (nOd < dOn) ? -1 : ((nOd > dOn) ? +1 : 0);
}

Expand Down

0 comments on commit d5b468a

Please sign in to comment.