Compare commits
1
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d04f6c9608 |
@@ -82,7 +82,13 @@ public class Rational {
|
|||||||
}
|
}
|
||||||
|
|
||||||
//TODO
|
//TODO
|
||||||
public static Rational divide(Rational r1, Rational r2) {return r1.divide(r2);}
|
public static Rational divide(Rational r1, Rational r2) {
|
||||||
|
if (r2.numerator == 0) {
|
||||||
|
System.out.println("You can't divide a number by zero!");
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
return r1.divide(r2);
|
||||||
|
}
|
||||||
|
|
||||||
// PROVIDED - String representation
|
// PROVIDED - String representation
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
Reference in New Issue
Block a user