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

kyj_rpn_calc

RPN(Reverse Polish Notatio) library

2 releases

0.1.2 Jan 26, 2023
0.1.1 Jan 26, 2023

#5 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 = rust_lib::eval(src).unwrap();
println!("{}", a); // →9

No runtime deps