Thanks a lot for that information you posted. Helpful and interesting.
Your code: Code: (((coordinate >> 3) / 8) << 3) * 8 simpler: Code: (((coordinate >> 3) >> 3) << 3) << 3 simplest: Code: (coordinate >> 6) << 6 Divides by 64, then multiplies by 64, which clears the last 6 bits of coordinate, getting the highest number that is divisible by 64 that is less than or equal to coordinate. It's the same thing as Code: (coordinate / 64) * 64 and Code: coordinate & ~63 But multiply and divide by powers of 2 is much slower than bit shifting.
(((coordinate >> 3) / 8) << 3) * 8
(((coordinate >> 3) >> 3) << 3) << 3
(coordinate >> 6) << 6
(coordinate / 64) * 64
coordinate & ~63