Anyway I have tested it with this little program and it's all ok:
Code:
#include <stdio.h>
float AngleNormalize(float angle)
{
if (angle >= 180)
angle -= 360 * (int)(angle / 360 + 0.5);
if (angle < -180)
angle += 360 * (int)(-angle / 360 + 0.5);
return angle;
}
main()
{
float a;
float b;
for (a = -2532.3; a < 3602.3; a += 0.1235)
{
b = AngleNormalize(a);
if (b >= 180 || b < -180)
{
printf("your code is wrong !\n");
return;
}
}
printf("your code is right !\n");
}
Also the asserts are never failed in YaPB. You can try playing YaPB for a few round and I'm pretty sure you'll find no angles are mess up.
