๐งฎ Rug-Calc
A zero-copy, high-performance evaluator for arbitrary-precision scientific computing. Powered by Rug, it delivers extreme accuracy and numerical stability with minimal memory overhead.
โจ Features
- ๐ High Performance: Features a non-recursive architecture that evaluates expressions in a single traversal, ensuring predictable and blazing-fast execution.
- โ๏ธ Arbitrary Precision: Engineered with 2560-bit internal precision, far exceeding the limitations of standard hardware floats for mission-critical calculations.
- ๐ฆ Zero-Copy & Efficient: Utilizes byte-level scanning and a custom state-machine to minimize memory allocations and CPU overhead during expression parsing.
- ๐งช Rich Mathematical Suite: Supports 40+ built-in functions, including advanced Trigonometry, Gamma, Zeta, Airy, and Error functions.
- ๐ญ Scientific Constants: Instant, high-precision access to fundamental constants: Pi (P), e (E), Catalan (C), and ln 2 (L).
- ๐จ Smart Formatting: Provides versatile output options, including fixed-point rounding and "clean" string formatting with support for up to 700 decimal places.
- ๐ก๏ธ Robust Stability: Designed for applications requiring extreme numerical stability and graceful error handling over panics.
๐ Quick Start
Add this to your Cargo.toml:
[]
= "0.1.3"
โจ Example Usage
The following example demonstrates how to use
use Calculator;
let mut calc = new;
// Simple arithmetic
let result = calc.run.unwrap;
// Advanced functions (Calculating cos(sin(ฯ/4)))
let cos_sin_pi_4 = calc.run.unwrap;
// infinitely nested scientific computing
let result = calc.run.unwrap;
// High-precision string output (50 decimal places)
let pi_str = calc.run_round.unwrap;
println!;
Contributing
Contributions are welcome! Please open issues or pull requests on GitHub.
License
This project is licensed under the MIT License.