Crates.io | expr_rs |
lib.rs | expr_rs |
version | 0.0.0 |
source | src |
created_at | 2022-05-30 21:59:07.856706 |
updated_at | 2022-05-30 21:59:07.856706 |
description | A safe and simple math evaluator for Rust and Python. |
homepage | |
repository | https://github.com/Cryptex-github/expr.rs |
max_upload_size | |
id | 597160 |
size | 20,961 |
A safe and simple math evaluator for Rust.
Basic operations such as
are supported
Features like sin, cos, tan, log, and more are planned for the future.
A python interface is also planned for the future.
use expr_rs::parser;
assert_eq!(parser::eval("1 + 2").unwrap().to_string(), "3");
In Python
import expr_rs
assert expr_rs.eval("1 + 2") == 3
In CLI
cargo install expr_rs
expr 1 + 2