Faster remainders when the divisor is a constant: beating compilers and libdivide
Daniel Lemire
FEBRUARY 8, 2019
I believe that all optimizing C/C++ compilers know how to pull this trick and it is generally beneficial irrespective of the processor’s architecture. We also published our benchmarks for research purposes. I make my benchmarking code available. The idea is not novel and goes back to at least 1973 (Jacobsohn).
Let's personalize your content