1 unstable release

0.1.1 Dec 27, 2022

#7 in #notatio

MIT license

4KB
53 lines

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

No runtime deps