3 ms·
> Quotient and modulo with a variable RHS is expensive For dividing ‘big’ bignums by ‘small’ divisors, I would use/tweak libdivide (https://libdivide.com/ http
by Someone 2y ago
> Quotient and modulo with a variable RHS is expensive
For dividing ‘big’ bignums by ‘small’ divisors, I would use/tweak libdivide (https://libdivide.com/ https://libdivide.com/), and spend the time to optimize the division.
For dividing ‘big’ bignums by ‘big’ divisors, that may not be worth it.
(Determining the correct values of the various ‘big’ and ‘small’ values left as an exercise for the reader. Those will depend on the hardware at hand)