Skip to main content

u32_rem

Function u32_rem 

Source
pub(crate) const fn u32_rem(n: u32, d: u32) -> u32
Expand description

Remainder calculation, constant time for a given divisor d. Based on “Faster Remainder by Direct Computation: Applications to Compilers and Software Libraries” by Daniel Lemire, Owen Kaser, and Nathan Kurz., Fig. 1.