From 47c5a5b342fba6585e83fc513a5297c13c54104a Mon Sep 17 00:00:00 2001 From: Stella Date: Thu, 19 Mar 2026 14:32:13 +0800 Subject: [PATCH 1/3] =?UTF-8?q?feat:=20=E4=B8=BA=E8=AE=A1=E7=AE=97?= =?UTF-8?q?=E5=99=A8=E6=B7=BB=E5=8A=A0=E5=B9=B3=E6=96=B9=E6=A0=B9=E6=8C=89?= =?UTF-8?q?=E9=92=AE=20-=20=E5=A2=9E=E5=8A=A0=20=E2=88=9A=20=E6=8C=89?= =?UTF-8?q?=E9=92=AE=20-=20=E5=AE=9E=E7=8E=B0=E5=B9=B3=E6=96=B9=E6=A0=B9?= =?UTF-8?q?=E8=AE=A1=E7=AE=97=EF=BC=8C=E8=B4=9F=E6=95=B0=E6=8F=90=E7=A4=BA?= =?UTF-8?q?=20-=20=E4=BF=9D=E6=8C=81=E7=95=8C=E9=9D=A2=E9=A3=8E=E6=A0=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Calculator/yash_pokharna/index.html | 3 ++- Calculator/yash_pokharna/script.js | 16 ++++++++++++++++ Calculator/yash_pokharna/style.css | 2 +- 3 files changed, 19 insertions(+), 2 deletions(-) diff --git a/Calculator/yash_pokharna/index.html b/Calculator/yash_pokharna/index.html index 897d7c425..3a33a3511 100644 --- a/Calculator/yash_pokharna/index.html +++ b/Calculator/yash_pokharna/index.html @@ -13,7 +13,8 @@ -
+ +
diff --git a/Calculator/yash_pokharna/script.js b/Calculator/yash_pokharna/script.js index a35f062c8..f0cad4e8c 100644 --- a/Calculator/yash_pokharna/script.js +++ b/Calculator/yash_pokharna/script.js @@ -36,3 +36,19 @@ function calculate() { alert("Error: Invalid operation."); } } + +function calculateSqrt() { + const value = parseFloat(display.value); + + if (isNaN(value)) { + alert("Error: 请输入有效数字"); + return; + } + + if (value < 0) { + display.value = "请输入非负数"; + return; + } + + display.value = Math.sqrt(value); +} \ No newline at end of file diff --git a/Calculator/yash_pokharna/style.css b/Calculator/yash_pokharna/style.css index ff47df328..408715b86 100644 --- a/Calculator/yash_pokharna/style.css +++ b/Calculator/yash_pokharna/style.css @@ -29,7 +29,7 @@ body { .buttons { display: grid; - grid-template-columns: repeat(4, 1fr); + grid-template-columns: repeat(5, 1fr); gap: 10px; } From ddc7c7a8761c35d3d9654207e610f6eda2706dc2 Mon Sep 17 00:00:00 2001 From: Stella Date: Thu, 19 Mar 2026 16:48:07 +0800 Subject: [PATCH 2/3] =?UTF-8?q?feat:=20=E4=B8=BA=E8=AE=A1=E7=AE=97?= =?UTF-8?q?=E5=99=A8=E6=B7=BB=E5=8A=A0=E5=B9=B3=E6=96=B9=E6=A0=B9=E6=8C=89?= =?UTF-8?q?=E9=92=AE=20(GLM-5=E6=B5=8B=E8=AF=95)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Calculator/bhpranit08/index.html | 1 + Calculator/bhpranit08/script.js | 23 +++++++++++++++++++++++ 2 files changed, 24 insertions(+) diff --git a/Calculator/bhpranit08/index.html b/Calculator/bhpranit08/index.html index aa6899d35..2355597a1 100644 --- a/Calculator/bhpranit08/index.html +++ b/Calculator/bhpranit08/index.html @@ -14,6 +14,7 @@

The Calculator

+
diff --git a/Calculator/bhpranit08/script.js b/Calculator/bhpranit08/script.js index aaa951975..be4cfd354 100644 --- a/Calculator/bhpranit08/script.js +++ b/Calculator/bhpranit08/script.js @@ -58,4 +58,27 @@ const equal = () => { realInput.value = "Error" inputEl.value = "Error" } +} + +const squareRoot = () => { + const inputEl = document.getElementById("input-el") + const realInput = document.getElementById("real-input-el") + + const currentValue = realInput.value + + if (currentValue === "" || currentValue === "Error") { + return + } + + const number = parseFloat(currentValue) + + if (number < 0) { + inputEl.value = "请输入非负数" + realInput.value = "" + return + } + + const result = Math.sqrt(number) + realInput.value = result.toString() + inputEl.value = result.toString() } \ No newline at end of file From cb81ad9022a0ab12c748608d08b7966464913bb2 Mon Sep 17 00:00:00 2001 From: Stella Date: Thu, 19 Mar 2026 17:03:26 +0800 Subject: [PATCH 3/3] =?UTF-8?q?feat:=20=E4=B8=BA=E8=AE=A1=E7=AE=97?= =?UTF-8?q?=E5=99=A8=E6=B7=BB=E5=8A=A0=E5=B9=B3=E6=96=B9=E6=A0=B9=E6=8C=89?= =?UTF-8?q?=E9=92=AE=20(GLM-5=E6=B5=8B=E8=AF=95)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Calculator/Pratik1968/index.html | 6 +++++- Calculator/Pratik1968/main.js | 19 +++++++++++++++++++ 2 files changed, 24 insertions(+), 1 deletion(-) diff --git a/Calculator/Pratik1968/index.html b/Calculator/Pratik1968/index.html index 5f4df68aa..84edf2fe6 100644 --- a/Calculator/Pratik1968/index.html +++ b/Calculator/Pratik1968/index.html @@ -17,7 +17,9 @@ power:"7", clear:"8", backspace:"9", - decimal:"." + decimal:".", + sqrt:"10", + negate:"11" } @@ -30,6 +32,7 @@
+ @@ -45,6 +48,7 @@ +