Given an Angle (A) that is between 0 and 359 degrees

and given Angle (B) the is also between 0 and 359 degrees

how to determine the direction and Miniimum # of degrees to turn (A) so it equals (B)

Note : A needs to increment towards B, not just be assigned a new value… So A will either be INCREMENTED or DECREMENTED by 1 degree at a time …

So if A were 0 and B were 45, thats easy, Increment by 1

If A were 45 and B were 0, then decrement

but if A were 45 and B were 350, it is Decrement by 1, but am not finding the easy math to solve that