Skip to main content

Crate nbyte_int

Crate nbyte_int 

Source
Expand description

nbyte_int – Custom Sized Integer Types

§Features

  • Option<nbyte_int> is the same size as nbyte_int (usually - not guaranteed)
  • it has all byte variants of integers what else do you want?
  • a constant macro

§Constant Macros

Every type has a corresponding constant macro:

use nbyte_int::prelude::*;

const A: u40 = u40!(123456789012);
const B: i24 = i24!(-1024);

These will panic at compile time if the value doesn’t fit in the target bit width.

Modules§

literal
Compile-time checked literal constructors, one macro per type (i24!, u40!, …).
prelude
Everything you normally need, in one import.
types
The integer types: i24, i40, i48, i56, i72 through i120, and the unsigned equivalents u24, u40, … u120.