Skip to content

Add new power button feature#5

Open
Nazzoe wants to merge 1 commit intoa-a-ron:mainfrom
Nazzoe:main
Open

Add new power button feature#5
Nazzoe wants to merge 1 commit intoa-a-ron:mainfrom
Nazzoe:main

Conversation

@Nazzoe
Copy link

@Nazzoe Nazzoe commented Mar 15, 2026

Pull Request Summary

Title: Add exponentiation support to calculator (UI, API, and tests)

Summary:
This PR adds a new exponentiation feature to the calculator app. It includes:

  • Front-end button and input handling for ^
  • API support in api/controller.js for the power operation
  • Unit tests for exponentiation in test/arithmetic.test.js

What changed

  1. Added ^ button in public/index.html
  2. In public/client.js, mapped ^ to operation=power and added keypress handling for ^
  3. In api/controller.js, added 'power': function(a, b) { return Math.pow(a, b); }
  4. Added exponentiation test cases in test/arithmetic.test.js
  5. Added comment documentation in tests showing exponent function was added

Reason

  • Extends core calculator functionality beyond add/sub/mul/div
  • Demonstrates end-to-end Copilot-assisted feature implementation
  • Adds regression coverage for exponent behavior

Closes #4

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.

Feature Request: Add Exponential Function in Calculator UI #2 (Practice) #4

1 participant