From 25c1ce5751c477f8258df3c0aab74792e620c0b5 Mon Sep 17 00:00:00 2001 From: Akintayo Durotoye Date: Wed, 4 Mar 2026 11:26:21 +0000 Subject: [PATCH 1/2] power and module button added --- api/controller.js | 2 ++ public/client.js | 6 ++++++ public/index.html | 2 ++ 3 files changed, 10 insertions(+) diff --git a/api/controller.js b/api/controller.js index 100fc02..f71e2ae 100644 --- a/api/controller.js +++ b/api/controller.js @@ -15,6 +15,8 @@ exports.calculate = function(req, res) { 'subtract': function(a, b) { return a - b }, 'multiply': function(a, b) { return a * b }, 'divide': function(a, b) { return a / b }, + 'modulo': function(a, b) { return a % b }, + 'power': function(a, b) { return Math.pow(a, b) } }; if (!req.query.operation) { diff --git a/public/client.js b/public/client.js index 612f1b9..08295a5 100644 --- a/public/client.js +++ b/public/client.js @@ -32,6 +32,12 @@ function calculate(operand1, operand2, operation) { case '/': uri += "?operation=divide"; break; + case '%': + uri += "?operation=modulo"; + break; + case '^': + uri += "?operation=power"; + break; default: setError(); return; diff --git a/public/index.html b/public/index.html index db09b0b..e90b271 100644 --- a/public/index.html +++ b/public/index.html @@ -39,6 +39,8 @@ + + From 33a06c7d55296e2945ecad4d6b74a114ef403982 Mon Sep 17 00:00:00 2001 From: Akintayo Durotoye Date: Wed, 4 Mar 2026 11:31:11 +0000 Subject: [PATCH 2/2] power button added --- api/controller.js | 2 +- public/client.js | 6 +++--- public/index.html | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/api/controller.js b/api/controller.js index f71e2ae..f7a0f4c 100644 --- a/api/controller.js +++ b/api/controller.js @@ -15,7 +15,7 @@ exports.calculate = function(req, res) { 'subtract': function(a, b) { return a - b }, 'multiply': function(a, b) { return a * b }, 'divide': function(a, b) { return a / b }, - 'modulo': function(a, b) { return a % b }, + // 'modulo': function(a, b) { return a % b }, 'power': function(a, b) { return Math.pow(a, b) } }; diff --git a/public/client.js b/public/client.js index 08295a5..48b030e 100644 --- a/public/client.js +++ b/public/client.js @@ -32,9 +32,9 @@ function calculate(operand1, operand2, operation) { case '/': uri += "?operation=divide"; break; - case '%': - uri += "?operation=modulo"; - break; + // case '%': + // uri += "?operation=modulo"; + // break; case '^': uri += "?operation=power"; break; diff --git a/public/index.html b/public/index.html index e90b271..0572060 100644 --- a/public/index.html +++ b/public/index.html @@ -39,7 +39,7 @@ - +