#calculator #rpn

postfix

Postfix expression evaluator

4 releases

0.1.2 Sep 25, 2019
0.1.1 Sep 25, 2019
0.1.0 Sep 25, 2019
0.0.0 Sep 25, 2019

#1252 in Math

MIT license

8KB
151 lines

postfix

postfix is a postfix math notation calculator. Postfix notation are math expressions where the operators follow the operands. There is thus no need for braces as the order of the operators enforce the order of operations.

Example

extern crate postfix;
use postfix::PostfixCalculator;

let calculator = PostfixCalculator::new();
println!("result: {:?}", calculator.evaluate(&vec!["4", "2", "+"]));
// result: 6.0

No runtime deps