newbie floating point question

Tim Peters at
Thu Feb 21 21:41:47 CET 2002

> Why does this happen ?
> >>> .2
> 0.20000000000000001
> Is this the correct behavior for the Python 2.2 interpreter ?

It's both correct and inexcusable, maddening and highly desirable.  The main
difference between Python and other languages you may have used here is that
Python isn't lying to you (well, it is, but not as badly as most others):

More information about the Python-list mailing list