Skip to content

Refactor Calculator class and event handling#1112

Open
yashwaghmare21 wants to merge 1 commit into
Zroctve:mainfrom
yashwaghmare21:patch-1
Open

Refactor Calculator class and event handling#1112
yashwaghmare21 wants to merge 1 commit into
Zroctve:mainfrom
yashwaghmare21:patch-1

Conversation

@yashwaghmare21

Copy link
Copy Markdown

Refactor calculator logic and improve readability.

  • Refactored calculator logic to improve code readability and maintainability.

  • Fixed compute() logic for unary operations (sqrt, log, x²).

  • Fixed power (xʸ) operation to wait for exponent input before calculation.

  • Added divide-by-zero handling to prevent invalid outputs.

  • Replaced hardcoded values of π and e with Math.PI and Math.E.

  • Improved code structure with clear comments and better organization.

  • Removed redundant logic and improved overall flow.

  • You have linked this PR to the correct issue.

  • My code doesn't break any part of the project (Zero Octave-Javascript-Projects).

  • This PR does not contain plagiarized content.

  • My Addition/Changes works properly and matches the overall repo pattern.

  • The title of my pull request is a short description of the requested changes.

Refactored the calculator logic while preserving existing functionality. Added fixes for special operations and edge cases such as divide-by-zero and invalid inputs.

Refactor calculator logic and improve readability.
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