Skip to content

shenuramendis/calculator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Calculator

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.

Operations

The program currently supports the following operations and functions, which can be found in operations.py

  1. Addition (+)
  2. Subtraction (-)
  3. Multiplication (*)
  4. Division (/)
  5. Exponentiation (^)
  6. Unary minus (~)
  7. Factorials and/or Gamma (!)
  8. sine
  9. cosine
  10. tangent

The calculator is also able to detect instances of implicit multiplication.

Running the program

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.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages