Skip to content

add power button - #2

Open
akaz05p wants to merge 1 commit into
mainfrom
power-button
Open

add power button#2
akaz05p wants to merge 1 commit into
mainfrom
power-button

Conversation

@akaz05p

@akaz05p akaz05p commented Aug 3, 2025

Copy link
Copy Markdown
Owner

This pull request introduces a new "power" operation (x^y) to the calculator application, enabling users to perform exponentiation. The changes span the backend, frontend, and testing layers to ensure full support for the new feature.

Backend Changes:

  • Added a new power operation to the operations object in api/controller.js, using Math.pow to calculate exponentiation.

Frontend Changes:

  • Updated public/client.js to handle the ^ operator in the calculate function and keypress event listener. [1] [2]
  • Added a new button for the x^y operation in the calculator UI (public/index.html).

Testing Changes:

  • Added a comprehensive suite of tests for the power operation in test/arithmetic.test.js, covering various scenarios such as positive/negative powers, zero, and floating-point numbers.

Closes #1

@akaz05p akaz05p self-assigned this Aug 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

TO DO - You've been asked to add a new feature to the calculator application.

1 participant