/** * Wrap i into the range [0, max[ */ int wrap(int i, int max);