intfinity

Crates.iointfinity
lib.rsintfinity
version0.4.0
created_at2024-09-03 14:41:25.327064+00
updated_at2024-12-16 16:06:15.858851+00
descriptionAn abstraction over numeric types with infinity implemented.
homepage
repositoryhttps://github.com/samarthsoup/intfinity
max_upload_size
id1361719
size44,724
samarth (samarthsushi)

documentation

README

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.

Commit count: 44

cargo fmt