#integer #slice #optimized #precision #sign #store #inline

smallint

A library for optimized arbitrary precision integers

4 releases

0.2.2 Aug 8, 2022
0.2.1 Aug 3, 2022
0.2.0 Aug 3, 2022
0.1.0 Aug 3, 2022

#2891 in Rust patterns

MIT license

55KB
1.5K SLoC

A crate for small integer optimization. Provides the SmallInt type. When possible this will inline an integer and store it on the stack if that integer is small. However, for larger values, this will be instead stored on the heap as a pointer to a u32 slice, a length, and a sign.

Dependencies

~100KB