mathematical expression evaluator with the Shunting Yard Algorithm.
This implementation of the Shunting Yard Algorithm has:
- no support for unary operations like '-1' or '1+(-2)'
- no support for functions like sqrt(64)
The calculator
supports the following:
Operations:
- '-' (subtraction)
- '+' (addition)
- '*' (multiplication)
- '/' (division)
- '^' (exponent)
Supports Parenthesis
Number formats:
- integers
- floats
go run main.go
> 5*2*(1*9)
90
> 5+2*(1*9)+5^2
48
To run tests:
go test ./...
Input -> Lexical Analysis -> Parsing (Shunting Yard) --> Evaluate --> Output