Skip to content

Commit e5cf5e6

Browse files
Removed the issue
1 parent bd9a2f4 commit e5cf5e6

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/simplejavacalculator/Calculator.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,12 @@ private Double calculateBiImpl() {
2121
return num2;
2222
}
2323
if (mode == BiOperatorModes.add) {
24-
return num1 + num2;
24+
if(num2!=0) {
25+
return num1 + num2;
26+
}
27+
else {
28+
return num1;
29+
}
2530
}
2631
if (mode == BiOperatorModes.minus) {
2732
return num1 - num2;

0 commit comments

Comments
 (0)