| Crates.io | bt_math |
| lib.rs | bt_math |
| version | 0.3.1 |
| created_at | 2024-11-19 09:16:23.360424+00 |
| updated_at | 2025-03-17 03:16:21.880676+00 |
| description | Basic math expression evaluator library. Support basic math operators (+,-,*,/,^), parenthesis, and functions such as log10, ln, log2, exp, sin, cos, tan, asin, acos, atan, abs, sqrt. Support PI and E (Euler's number) as constants. Support negative numbers/expressions. Pow(x,y) supported |
| homepage | https://github.com/bachuetech/bt_math |
| repository | https://github.com/bachuetech/bt_math.git |
| max_upload_size | |
| id | 1453045 |
| size | 21,850 |
BT MATH
A simple implementation of an expression evaluator that can handle basic arithmetic operations, parentheses, and some mathematical functions that provide a way to evaluate mathematical expressions using RPN (Reverse Polish Notation) implemented in two parts: parsing and evaluation.
Support the use of PI and E (Euler's number), negative numbers or expressions, and the following functions: ln, log2, exp (e^#), asin, acos, atan, sin, cos. tan. abs, sqrt. log10
let expression = "2 + 3 * 4";
.......
let f = evaluate_expression(expression).unwrap();
GPL-3.0-only