Unexpected output when converting to an integer with int()

MarkT:
Because floating point results are inexact, you cannot make assumptions like this.

This is a profound point. To any programmers that aren't already aware of the significance of this statement, it's something you'll want to read up on.

The gist is this: Floating point values don't store exact values, they store approximations. There are many integer values that can't be stored as floating point values, but will instead be just slightly off. The implications of this are obvious for cumulative math -- and particular, code that deals with money. Higher precision does not solve the root problem. You may have 64 bits of precision, but all that means is you might get a whole bunch of .999999s when what you really wanted is .0.

(WOOHOO! 1000 posts. And I am no longer a God member. Edison outranks God? Well, I guess they both said "Let there be light." ;))