Skip to content

Vociferix/aint

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Aint

Aint is a crate implementing integers of non-standard bit widths between 1 and 127. These integer types are represented by the next largest built-in Rust integer, but are bounded to the range and behaviors of the advertised bit width. That is, T::MIN and T::MAX, are what would be expected for the integer T with N bits, and similarly, wrapping, saturating, and overflow behaviors match what would be expected for a hypothetical built-in integer T with N bits.

Example

fn add(a: i13, b: i13) -> i13 {
    a + b
}

let x = i13!(100);
let y = add(x, i13!(-42));
assert_eq!(y, i13!(58));

See the documentation for details.

About

Arbitrary width integers between 1 and 128

Resources

License

Apache-2.0, MIT licenses found

Licenses found

Apache-2.0
LICENSE-APACHE
MIT
LICENSE-MIT

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages