Skip to main content

Module checked_arithmetics

Module checked_arithmetics 

Source

Functionsยง

checked_int_div
Division implementation that fails in case when a`` isn't divisible by b`
checked_log_2
Computes the binary logarithm of val.
log2_ceil_usize
Computes the binary logarithm of $n$ rounded up to the nearest integer.
min_bits
Returns the number of bits needed to represent $n$.
strict_log_2
Computes binary logarithm of val. If val is not a power of 2, returns None.