This is a simple calculator built in Python 3.14, which first converts the user input (infix) to a Reverse Polish Notation (RPN) expression.
The expression is converted using a shunting-yard algorithm and is then evaluated.
The program currently supports the following operations and functions, which can be found in operations.py
- Addition (+)
- Subtraction (-)
- Multiplication (*)
- Division (/)
- Exponentiation (^)
- Unary minus (~)
- Factorials and/or Gamma (!)
- sine
- cosine
- tangent
The calculator is also able to detect instances of implicit multiplication.
To run the program, download run.py, exp.txt, and the rpn_calc folder. Edit exp.txt to contain your expressions as instructed. Run run.py in the terminal. An output file called "equals.txt" should be created in the same folder as your run.py.