From cef5b3535b529c93cd6bcbdde3fff3351b197c47 Mon Sep 17 00:00:00 2001 From: Sergey Kastornov Date: Fri, 24 Oct 2025 17:43:43 +0300 Subject: [PATCH 1/3] Revert "fix" This reverts commit 0e8c7813f9f41c0030917919f0c91ad4a014eb9c. --- index.html | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/index.html b/index.html index 09a18e6..21b1017 100644 --- a/index.html +++ b/index.html @@ -74,14 +74,7 @@ switch (operator) { case '+': result = firstOperand + secondOperand; break; case '-': result = firstOperand - secondOperand; break; - case '/': - if (secondOperand === 0) { - alert("Error: Division by zero!"); - result = 0; - } else { - result = firstOperand / secondOperand; - } - break; + case '/': result = firstOperand / secondOperand; break; } currentInput = result.toString(); operator = null; From 8531356ef6ea2c758b45df840da69445c29991a3 Mon Sep 17 00:00:00 2001 From: Sergey Kastornov Date: Fri, 24 Oct 2025 17:43:47 +0300 Subject: [PATCH 2/3] Revert "divide added" This reverts commit e276862d1af5765f2789416c2a82eab1ef31782d. --- index.html | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/index.html b/index.html index 21b1017..8bfd362 100644 --- a/index.html +++ b/index.html @@ -22,7 +22,7 @@
0
- + @@ -74,7 +74,6 @@ switch (operator) { case '+': result = firstOperand + secondOperand; break; case '-': result = firstOperand - secondOperand; break; - case '/': result = firstOperand / secondOperand; break; } currentInput = result.toString(); operator = null; From 58cb0ce68b69fe141c96f48364594f458465187f Mon Sep 17 00:00:00 2001 From: Roman Date: Wed, 1 Oct 2025 12:54:52 +0200 Subject: [PATCH 3/3] Add divide operation --- index.html | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/index.html b/index.html index 8bfd362..09a18e6 100644 --- a/index.html +++ b/index.html @@ -22,7 +22,7 @@
0
- + @@ -74,6 +74,14 @@ switch (operator) { case '+': result = firstOperand + secondOperand; break; case '-': result = firstOperand - secondOperand; break; + case '/': + if (secondOperand === 0) { + alert("Error: Division by zero!"); + result = 0; + } else { + result = firstOperand / secondOperand; + } + break; } currentInput = result.toString(); operator = null;