Skip to content

QuantumWizard888/mi

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

2 Commits
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

mi

Math Interpreter

Simple math expressions interpreter. Parsing is made using Shunting yard algorithm.

πŸ“š How to use

Some examples of mi usage:

python3 mi.py "2^2"
python3 mi.py "-11 +-25 --13.2 * (-4- 3.14)"
python3 mi.py "11 +25 -13.2 * (4- 3.14)"
python3 mi.py "4^(1/2)"
python3 mi.py "2^(2+3)"

βš—οΈ Tests

To run tests simply execute this command while in the root diectory of the project:

python3 -B -m pytest -v tests/test_op_func.py

πŸ’‘πŸ“Œ To Do

  • Add error and invalid expression input handling
  • Add pi/e constants recognition
  • Add different functions like sqrt(x), sin(x), cos(x), log(x) etc.
  • Add precision level change for floats