I use unsigned byte's 0-255 binary overflow / wraparound, as this saves on certain bounds checks (conditional branches) in a infinitely wrapping game world.
Is there a way, using bit operators, to wrap on an arbitrary power-of-2 value, e.g. 2^5 = 32?
This would happen non-conditionally, so that if the value were >= 32, we'd wrap as usual, and if it were < 32, the value would remain the same.