pub enum IntBits {
B8,
B16,
B32,
B64,
B128,
B256,
}Expand description
Width of an integer type, in bits.
The tower stops at 256 because the standard does, and every width is
a fixed stride, so the FOR and delta cascades in zu-encoding need
the width registered and nothing else.
Variants§
Implementations§
Source§impl IntBits
impl IntBits
Sourcepub fn holds(self, word: u64, signed: bool) -> bool
pub fn holds(self, word: u64, signed: bool) -> bool
Whether a 64 bit lane word is a value of an integer type this wide.
The word is two’s complement for a signed type and plain for an unsigned one, which is the reading the lane gives it, so this asks about the value rather than about the bits. A type 64 bits or wider holds every word there is, since a word is all a lane carries and the wide towers have no lane of their own.
Sourcepub fn for_digits(digits: u16) -> Option<IntBits>
pub fn for_digits(digits: u16) -> Option<IntBits>
The narrowest width that holds digits decimal digits, which is
what INT(p) (GV09) asks for. None when no width in the tower
is wide enough.
The bound is the count of decimal digits a width holds in full: an i64 reaches 9_223_372_036_854_775_807, so it holds every 18 digit number and only some 19 digit ones, and a type that promised 19 would be promising a range it does not have.