Crates.io | rpn_calc_karin |
lib.rs | rpn_calc_karin |
version | 0.1.1 |
source | src |
created_at | 2022-12-27 08:33:49.657557 |
updated_at | 2022-12-27 08:33:49.657557 |
description | RPN(Reverse Polish Notatio) library |
homepage | https://github.com/kujirahand/book-rust/tree/main/src/ch4/rpn_calc/README.md |
repository | |
max_upload_size | |
id | 746107 |
size | 3,750 |
Reverse Polish notation (RPN) Calc.
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
}