I noticed nobody gave an answer for the second part of your question, about why the code does not work as expected for posterity's sake.
The answer to that is hidden in Eric's answer: Because arithmetic operations must be performed to determine the output of a number (e.g. 9.2), floating point numbers are essentially an estimation of a number, not a precisely defined representation of the number.
For integers, we are simply counting up. A 3 follows a 2, which follows a 1, and that took 2 bits to display. To go to 4, however, we need a third bit. Floating point, however, uses scientific notation to store the number, which is how it's able to represent decimal numbers.
To borrow from this answer for a similar question, in floating-point notation the number "9.2" is actually this fraction:
5179139571476070 * 2 -49
That's not a perfect representation of 9.2, so depending on the size of the float it will be off by some small fraction.
There are boundaries within the floating point "number line" that are more or less accurate. Depending on where things fall, the floating-point representation may be exact.
If you need the exact number, you should use an integer. If you need an exact number that has decimals, your only real option is to split out the decimal portion and use another integer for that portion of the number.