Check this code:
float velocity, acc, time;
.
.
velocity = velocity - acc * time
if( velocity == 0.0 )
{
// Do something
}
else
{
// Do something else
}
This code isn't always workng. When the velocity is supposed to be exact 0, it sometimes turns out to be something really small, like 2e-09 or something, but not absolute zero.
How do I make this work?