Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

power features #5

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

power features #5

wants to merge 1 commit into from

Conversation

stargazer4
Copy link
Contributor

This pull request introduces the power operation to the calculator application. The changes include adding the power function to the calculation methods in the server-side controller, adding a case for the power operation in the client-side JavaScript, and adding a button for the power operation in the HTML user interface.

Server-side changes:

  • api/controller.js: Added the 'power' function to the list of calculation methods in exports.calculate. This function uses the Math.pow method to calculate the result of raising the first argument to the power of the second.

Client-side changes:

  • public/client.js: Added a case for the '^' operation in the calculate function. When this operation is selected, the URI is updated to include "?operation=power".
  • public/index.html: Added a button that calls operationPressed('^') when clicked. This button allows users to select the power operation.

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.

1 participant