/shunting-yard-algorithm-rust

Implementing shuting yard algorithm and reverse polish notation to create a simple rust calculator

Primary LanguageRust

Rust Calculator

This is a rust calculator made using shunting yard algorithm and reverse polish notation.

This project was made to learn how to build a calculator without use eval() function.

How to run?

Create a clone of this repository and enter on directory:

$ git clone https://github.com/jotavetech/shunting-yard-algorithm-rust
$ cd shunting-yard-algorithm-rust

To run this project you will also need the Rust Compiler installed.

With everything done, run it using cargo run command in your terminal and type an simple expression, without using (), just + - / * and numbers.

$ cargo run

Enter your expression:
> 20 + 10 / 2 * 3

Result of your expression is 35

References