Crates.io | rpn_lib |
lib.rs | rpn_lib |
version | 0.1.6 |
source | src |
created_at | 2022-05-18 23:28:03.737256 |
updated_at | 2022-11-29 00:07:45.844316 |
description | RPN(Reverse Polish Natation) library |
homepage | https://github.com/takeweb/rpn_lib/README.md |
repository | https://github.com/takeweb/rpn_lib |
max_upload_size | |
id | 589403 |
size | 3,874 |
Reverse Polish Notation (RPN) Calc.
cargo add rpn_lib
fn main() {
let src = String::from("1 2 + 3 * ");
let a = rpn_lib::eval(src).unwrap();
println!("{}", a); // →9
}
fn main() {
let result = rpn_lib::eval_from_str("1 2 3 * +");
println!("{}", result); // →7
}