#rpn #polish #reverse #calc #notatio #reverse-polish-notation

maitakedayo_rpn_calc

RPN(Reverse Polish Notatio) library

1 unstable release

0.1.1 Jun 14, 2023

#8 in #notatio

MIT license

4KB

RPN(Reverse Polish Notation) Calc

Reverse Polish notation (RPN) Calc.

Example

fn main() {
    let src = String::from("1 2 + 3 * ");
    let a = rpn_calc::eval(src).unwrap();
    println!("{}", a); // →9
}
fn main() {
    let result = rpn_calc::eval_str("1 2 3 * +");
    println!("{}", result); // →7
}

lib.rs:

RPN Calc

Reverse Polish notation (RPN) Calc.

Example

let src = String::from("1 2 + 3 * ");
let a = rpn_calc::eval(src).unwrap();
println!("{}", a); // →9

No runtime deps