@@ -61,6 +61,7 @@ public class Interpreter implements Expr.Visitor<Object> {
}
case SLASH -> {
checkNumberOperand(expr.operator, left, right);
+ if (((Double) right) == 0D) throw new RuntimeError(expr.operator, "Division by Zero.");
yield (double) left / (double) right;
case STAR -> {