If I recall, there's a problem comparing floats for equality because of how they are stored and computed. They are not exact values; hence the inequality. I would substract both numbers together and check if the difference is in a certain range like this:Code:#define MIN_MAX_RANGE 0.01f // ... float a = 12.345f; float b = 12.345f; if(std::abs(a - b) <= MIN_MAX_RANGE) // do something