Hey internets. I am having a VERY strange issue in C. I am deriving a float value, and then checking to see if it is greater than 0. However, the comparison is always evaluating to true, even if the value is less than zero. Here is the code:
if (sVel > 0.0f)
{
sVel += 1.0f;
sVel -= 1.0f;
NSLog(@"SEP VEL: %1.6f", sVel);
return;
}
So, setting sVel to 100 prints the log as expected and hits the return statement; cool. However, setting sVel to -100 does not print the log and still hits the return statement. I am utterly confused and I'm not sure where to start tracking this one down...