| Crates.io | intfinity |
| lib.rs | intfinity |
| version | 0.4.0 |
| created_at | 2024-09-03 14:41:25.327064+00 |
| updated_at | 2024-12-16 16:06:15.858851+00 |
| description | An abstraction over numeric types with infinity implemented. |
| homepage | |
| repository | https://github.com/samarthsoup/intfinity |
| max_upload_size | |
| id | 1361719 |
| size | 44,724 |
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.
Add intfinity to your Cargo.toml:
[dependencies]
intfinity = "0.4.0"
use intfinity::int;
fn main() {
let a = int::new(42);
let b = int::posinf;
let result = a + b;
assert_eq!(result, int::posinf);
}
This project is under the MIT license.