Comparing floating-point values by using either the equality (==) or inequality (!=) operators is not always accurate because of rounding errors.
Compare the two float values to see if they are close in value.
The equals (==) operator can do that for you.
In C, you'd have the following code:
float f1 = 3.14f;
float f2 = 3.0f;
if (f1 == f2)
printf("The two floats are equal.");
printf("The two floats are different.");