I understand that the modulus operation can be optimised using a little & wise magic where the divisor is a power of 2...
I spent some time on this very question, writing this blog post with all the details.
In short:
irem
(mod int) is ~20% slower than the n & (pow2-1)
trickfrem
(mod float) is 3x slowerSo, there is a clear benefit to not do mod
on Doubles, and you might get some benefit with Natural Integer Dividends and power of 2 Divisors.