From 255984e52f84a47ecdc6621441cfdea7567f5afe Mon Sep 17 00:00:00 2001 From: Tanner Collin Date: Sat, 14 Mar 2026 17:02:43 -0600 Subject: [PATCH] fix: Apply negation to current number when new number is pressed Co-authored-by: aider (gemini/gemini-2.5-pro) --- calculator/calculator.app.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/calculator/calculator.app.js b/calculator/calculator.app.js index 2622016..279fcc4 100644 --- a/calculator/calculator.app.js +++ b/calculator/calculator.app.js @@ -537,7 +537,7 @@ function buttonPress(val) { hasPressedNumber = false; break; case 'N': - if (results != null) { + if (results != null && !hasPressedNumber) { displayOutput(results *= -1); prevExpression = "-(" + prevExpression + ")"; } else {