Crate calculator_util[−][src]
Expand description
calculator_util
Useful functions and traits for writing a calculator app in Rust.
This crate has implementation for String
, that you can parse mathmatical
equation strings to Reverse Polish Notation, aka postfix notation, which can
be used for mathmatical evaluation with some provided functions under operations.rs
.
Example
use calculator_util::{ExprParser, number::Number};
let equation = "(5+6) * 7".to_string();
let result = equation.eval();
assert_eq!(result, Number::from(77));
println!("{}", result); // 77