This has to do with the complex way floats store decimal numbers. Both ints and floats use 32-bits to represent numbers, but the precision on floats varies depending on the kind of significant digits it has to store. Floats tend to be slightly inaccurate as a result and you should not use them to represent values that need accuracy (like money).