Crate rpn_reckoner

Crate rpn_reckoner 

Source
Expand description

§RPN-Reckoner

Reverse Polish Notation (: RPN) - Reckoner

§Example1

let expression = String::from("1 2 +");
let solution = rpn_reckoner::eval(expression).unwrap();
println!("{}", solution); // -> 3

§Example2

let expression = String::from("5 2 - 3 +");
let solution = rpn_reckoner::eval(expression).unwrap();
println!("{}", solution); // -> 6

§Example3

let expression = String::from("5 2 3 ^ +");
let solution = rpn_reckoner::eval(expression).unwrap();
println!("{}", solution); // -> 13

§Example4

let expression = String::from("4 ! 2 +");
let solution = rpn_reckoner::eval(expression).unwrap();
println!("{}", solution); // -> 26

Functions§

eval
The function computes RPN expressions