https://github.com/a1393323447/math_rs
A rust lib provides math expression parse and big integer.
https://github.com/a1393323447/math_rs
bigint biginteger math rust
Last synced: about 2 months ago
JSON representation
A rust lib provides math expression parse and big integer.
- Host: GitHub
- URL: https://github.com/a1393323447/math_rs
- Owner: a1393323447
- License: gpl-2.0
- Created: 2021-12-10T03:02:09.000Z (about 4 years ago)
- Default Branch: master
- Last Pushed: 2021-12-10T05:02:19.000Z (about 4 years ago)
- Last Synced: 2025-09-27T02:25:22.430Z (4 months ago)
- Topics: bigint, biginteger, math, rust
- Language: Rust
- Homepage:
- Size: 51.8 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Math-rs
## 简介
使用纯rust编写的表达式解析、运算库。支持常见数学运算、设置变量。
## Example
```rust
use mathrs::expr::Expression;
let mut expr = Expression::parse("1 + 2*3 - x1 * x2");
expr.set_variable("x1", "2")
.set_variable("x2", "2 * 2");
let result = expr.excute();
println!("result = {}", result);
expr.set_variable("x1", "sin(3.14)")
.set_variable("x2", "1");
let result = expr.excute();
println!("result = {}", result);
```
