Originally Posted by

**corsica** Maybe it also helps to have a real-world example. Suppose you're navigating a ship with a compass. The compass bearing (the direction in which you're sailing) can range from 0 and 360 degrees. 0 degrees means that you're sailing northwards, 90 degrees means you're sailing eastwards, 180 degrees means you're sailing southwards, and 270 degrees means you're sailing westwards.

Now suppose you have an initial compass bearing of 300 degrees, and then proceed to give your ship a 250 degrees turn. Adding these values together gives a new bearing of 550 degrees. However this value is not on your compass. To find the compass bearing you perform a modulo operation with 360 (because the compass has a range of 360 degrees). So your new bearing is:

$\displaystyle \text{mod}(550,360)=550-\text{floor}(\frac{550}{360})\cdot 360=550-\text{floor}(1.53)\cdot 360)=550-1\cdot 360=190$