Crates.io | single-digit-rpn |
lib.rs | single-digit-rpn |
version | 0.1.0 |
source | src |
created_at | 2020-06-14 12:37:27.542894 |
updated_at | 2020-06-14 12:37:27.542894 |
description | Calculate single digit Reverse Polish Notation |
homepage | |
repository | https://github.com/foresta/single-digit-rpn |
max_upload_size | |
id | 253836 |
size | 13,681 |
This package is a single digit RPN calculator. Only single digit RPN is supported:
123++ => 1 + (2 + 3)
4 5 3 - * => 4 * (5 - 3)
7 8*9- => 7 * 8 - 9
extern crate single_digit_rpn;
use single_digit_rpn::rpn;
let result: f64 = rpn("123++").unwrap();
assert_eq!(result, 6.0);
You can find example code in the examples directory.
To execute it, do the folloing:
cargo run --example cli