8 unstable releases (3 breaking)
0.4.0 | Dec 16, 2024 |
---|---|
0.3.3 | Sep 29, 2024 |
0.2.2 | Sep 4, 2024 |
0.1.0 | Sep 3, 2024 |
#1128 in Math
136 downloads per month
19KB
497 lines
intfinity
Rust crate that provides a generic type for representing and working with both finite and infinite numeric values. It supports operations that automatically handle overflow and underflow, mapping them to positive or negative infinity as appropriate.
Getting Started
Add intfinity
to your Cargo.toml
:
[dependencies]
intfinity = "0.4.0"
Example Usage
use intfinity::int;
fn main() {
let a = int::new(42);
let b = int::posinf;
let result = a + b;
assert_eq!(result, int::posinf);
}
License
This project is under the MIT license.