FlameDuck #1 This way should be faster than mod: It's not. Doing a division and a multiplication is much slower than doing a modulus.