Quote:
Originally Posted by Gray Adams
Why not just...
Code:
public static double boundAngle0to360Degrees(double angle)
{
return((angle+360)%360);
}
|
What if angle is equal to -361?
It's awesome that you guys are analyzing the code and you have already taught me something new (that Java's "%" operator works on floating point values...as a primarily C++ guy, I have it burned into my brain that thou shalt use "fmod" for floating point modulus). But if this is the part of the code that engenders the most discussion, then I'm a bit disappointed
