Crates.io | taz |
lib.rs | taz |
version | 1.0.0 |
source | src |
created_at | 2023-02-02 21:15:23.395557 |
updated_at | 2024-08-15 13:03:49.309328 |
description | Taz is Rust library to evaluate a mathematical expression |
homepage | |
repository | https://github.com/BaGoA/Taz |
max_upload_size | |
id | 775083 |
size | 100,628 |
Taz is Rust library to evaluate a mathematical expression.
For example we can evaluate the following expression:
Build of Taz is made by Rust tool Cargo
To build Taz, you can use the following command:
*cargo build* to compile in debug mode
*cargo build --release* to compile in release mode
To launch Taz units tests, you can use the following command:
*cargo test* to launch tests in debug mode
*cargo test --release* to launch tests in release mode
Taz code documentation is made also by Cargo with the following command:
*cargo doc* to generate the documentation
*cargo doc --open* to open the documention in your browser
The evaluation begin by a tokenization. This step transform a string representing the expression to list of tokens which correspond to infix expression
Then, we convert this infix expression into postfix expression. Indeed an evaluation of postfix expression is easier.
Finally we evaluate the posfix expression by stack method.
In this expression we can use following predefined constant:
If you want add a new constant, you must go into src/constants.rs file and add it like other constants.
You can also use following predefined functions:
If you want add a new predefined function, you must go into src/functions.rs file and add it like other predefined functions.