We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 3cfe6f4 commit a5d4253Copy full SHA for a5d4253
Calculator.java
@@ -6,4 +6,8 @@ public double divide(int a, int b) {
6
if (b == 0) throw new ArithmeticException("Divide by zero");
7
return (double) a / b;
8
}
9
+ public double squareRoot(double number) {
10
+ if (number < 0) throw new IllegalArgumentException("Cannot calculate square root of negative number");
11
+ return Math.sqrt(number);
12
+ }
13
0 commit comments