We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents c0918e6 + 191542f commit e09547aCopy full SHA for e09547a
1 file changed
src/main/java/com/thealgorithms/Calculator.java
@@ -4,8 +4,12 @@ public class Calculator {
4
public int add(int a, int b) { return a + b; }
5
public int subtract(int a, int b) { return a - b; }
6
public int multiply(int a, int b) { return a * b; }
7
+<<<<<<< HEAD
8
public double divide(int a, int b) {
9
if (b == 0) throw new ArithmeticException("Divide by zero!");
10
return (double) a / b;
11
}
12
+=======
13
+ public double divide(int a, int b) { return (b != 0) ? (double)a / b : 0; }
14
+>>>>>>> feature/calculator
15
0 commit comments