Compare commits
1
Commits
d885803a90
...
develop
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d04f6c9608 |
@@ -82,7 +82,13 @@ public class Rational {
|
||||
}
|
||||
|
||||
//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
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user