(avoid division and modulo, division is slow) Fortunately, GCC will optimize divisions by powers of two to simple bitwise shifts :)