Keeping rotation values within a range of 0 to 360°
Modulo's partner in crime.

Alternatively to modulus could use its partner in crime div. a // (2 * pi) is how many integer multiples of 2pi the value is, eg if a = -3 * pi / 2 we get -1. If we subtract -1 multiples of 2pi  from a we get pi / 2.

a - a // (2 * pi) * 2 * pi