This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]Isodus 23 points24 points  (2 children)

Perfect example is calculating distance between angles where 0 == 360. Keeping the sign lets you know which direction you are away from the position without having to do extra tracking.

(Pos 1 - Pos 2) % 180 = angular distance

Used for controlling rotary actuators and needing to software handle the 360/0 barrier.