Skip to content

power feature #29

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

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

power feature #29

wants to merge 1 commit into from

Conversation

stargazer4
Copy link
Contributor

@stargazer4 stargazer4 commented Oct 1, 2024

This pull request adds a new "power" operation to the calculator application, allowing users to perform exponentiation. The most important changes include updating the backend to support the new operation, modifying the frontend to handle the new operation, and adding a new button for the exponentiation operation.

Backend changes:

  • api/controller.js: Added a new function power to handle exponentiation in the operations object.

Frontend changes:

  • public/client.js: Updated the calculate function to recognize the ^ operator and map it to the new "power" operation.
  • public/index.html: Added a new button for the exponentiation operation (^) in the calculator interface.

@stargazer4 stargazer4 requested a review from Copilot January 29, 2025 21:00
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

Comments suppressed due to low confidence (1)

api/controller.js:19

  • The newly added 'power' operation does not appear to have associated tests. Please add coverage for exponentiation, including edge cases such as negative exponents.
'power':    function(a, b) { return Math.pow(a, b) },

Tip: Copilot code review supports C#, Go, Java, JavaScript, Markdown, Python, Ruby and TypeScript, with more languages coming soon. Learn more

@stargazer4 stargazer4 requested a review from Copilot March 12, 2025 22:09
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This pull request adds an exponentiation ("power") operation to the calculator application.

  • Added a new "power" operation in the backend via the operations object.
  • Updated the frontend "calculate" function to map the "^" operator to the "power" operation.

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
public/client.js Added case branch for "^" in the calculate logic.
api/controller.js Added "power" operation using Math.pow.

Tip: Copilot code review supports C#, Go, Java, JavaScript, Markdown, Python, Ruby and TypeScript, with more languages coming soon. Learn more

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