A nice thing about integers is that comparing them is clear: 10 equals 10 and 9 does not euqal 10.
With floating point numbers things are a lot less clear. Does 10.01 equal 10? What about 9.999998? There is no clear answer, it all depends on the application. While for some applications 10.01 might equal 10, other applications might need more accuracy.
That's why you always need to compare ranges. For example, x equals 10 if it falls between 9.99 and 10.01. One way to write that in C is `fabs( x - 10 ) < 0.01` (fabs is a function defined in math.h).
Another issue is that when you try to store a floating point number, let's say 10, it can be stored as 10.00000001. This is due to rounding the number to fit the internal representation (which is the IEEE 754 format most (if not all) of the time. Because of these rounding errors, you should always compare floating point numbers based on their range, as I mentioned above, even if you do really simple calculation like adding 0.1.