Faster remainders when the divisor is a constant: beating compilers and libdivide
Daniel Lemire
FEBRUARY 8, 2019
In some instances, libdivide can even be more efficient than compilers because it uses an approach introduced by Robison (2005) where we not only use multiplications and shifts, but also an addition to avoid arithmetic overflows. The computation of the remainder is nice, but I really like better the divisibility test. Can we do better?
Let's personalize your content