IEEE floats don't have "decimal" precision. It depends on the size of the mantissa, and other technical things. What you should do is determine the range of typical values and the allowable tolerance, and do something more along the line of:
if ( abs(x-y) < max_error_tolerable ) { ... } // equiv to if x == y
There's a big difference between the errors between these sets of numbers in float land:
1.000272394872 ( probably 5-7 decimal places accuracy )
129348947208123428923049823409283490342.0273428927 ( quite possible only a few decimal places due to need to keep whole number significant digits)
This post has a couple of good answers:
https://stackoverflow.com/questions/491 ... comparison
"Comparing for greater/smaller is not really a problem unless you're working right at the edge of the float/double precision limit."