develop #1

Open
Z.Gharagozloo.M wants to merge 4 commits from develop into main
Showing only changes of commit d04f6c9608 - Show all commits
+7 -1
View File
@@ -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