Module num

Source
Expand description

Integer and floating-point number formatting

Modulesยง

imp ๐Ÿ”’

Macrosยง

impl_Debug ๐Ÿ”’
impl_Display ๐Ÿ”’
impl_Exp ๐Ÿ”’
impl_int ๐Ÿ”’
int_base ๐Ÿ”’
integer ๐Ÿ”’
radix ๐Ÿ”’

Structsยง

Binary ๐Ÿ”’
A binary (base 2) radix
LowerHex ๐Ÿ”’
A hexadecimal (base 16) radix, formatted with lower-case characters
Octal ๐Ÿ”’
An octal (base 8) radix
UpperHex ๐Ÿ”’
A hexadecimal (base 16) radix, formatted with upper-case characters

Staticsยง

DEC_DIGITS_LUT ๐Ÿ”’

Traitsยง

DisplayInt ๐Ÿ”’๐Ÿ‘ป
GenericRadix ๐Ÿ”’๐Ÿ‘ป
A type that represents a specific radix

Functionsยง

exp_u128 ๐Ÿ”’
fmt_u128 ๐Ÿ”’
Specialized optimization for u128. Instead of taking two items at a time, it splits into at most 2 u64s, and then chunks by 10e16, 10e8, 10e4, 10e2, and then 10e1. It also has to handle 1 last item, as 10^40 > 2^128 > 10^39, whereas 10^20 > 2^64 > 10^19.
parse_u64_into ๐Ÿ”’
Helper function for writing a u64 into buf going from last to first, with curr.
udiv_1e19 ๐Ÿ”’
Partition of n into n > 1e19 and rem <= 1e19