Function lexical_util::div128::u128_divrem
source · [−]Expand description
Calculate the div/remainder of a value based on the radix.
This uses the largest divisor possible for the given size, and uses various fast-path approximations for different types.
- Powers-of-two can be cleanly split into 2 64-bit products.
- Division that can be simulated as if by multiplication by a constant.
- Cases of 2. with a power-of-two divisor.
- Fallback cases.
This returns the quotient and the remainder. For the number of digits processed, see min_step.