Skip to content

Conversation

@Heisenberg-Vader
Copy link

Add Stack-Based GUI Calculator with Powers, Roots, and Reciprocations

What it does:

  • This PR adds a GUI-based calculator using TKinter with the following features:
  • Stack-based evaluation using infix to postfix conversion (no eval() used).
  • Standard arithmetic operations: +, -, *, /, %, ^.
  • Supports square root via a^(1/2) and reciprocal (1/x) via a^(-1).
  • Handles negative numbers and parentheses correctly.
  • Simple, clickable TKinter buttons for all operations, numbers, and clear (C).

Example Usage:

  • 5^(-1) evaluates 1/5 = 0.20
  • 16^(1/2) evaluates sqrt(16) = 4.0
  • (-3+2)^2 evaluates to 1

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