View Single Post
Re: POD-bot back into shape.
Old
  (#331)
Pierre-Marie Baty
Roi de France
 
Pierre-Marie Baty's Avatar
 
Status: Offline
Posts: 5,049
Join Date: Nov 2003
Location: 46°43'60N 0°43'0W 0.187A
Default Re: POD-bot back into shape. - 02-04-2004

Quote:
Originally Posted by Whistler
...it's this:
if (angle >= 180)
angle -= 360 * (int)(angle / 360 + 0.5); // 0.5 is INSIDE the (int)(...)
If you do this then your code will behave wrong for large values of angle, do you know that ? 9_9

The function will exit and the angle will still be overflown.



RACC home - Bots-United: beer, babies & bots (especially the latter)
"Learn to think by yourself, else others will do it for you."