newb: Python Floating Point

Dan Bishop danb_83 at yahoo.com
Thu Mar 15 20:52:10 EDT 2007


On Mar 15, 6:09 pm, "johnny" <rampet... at gmail.com> wrote:
> When I do the following, rounding to 2 decimal places doesn't seem to
> work.  I should get 0.99 :

In binary, 0.99 is the recurring fraction 0.11 11110101110000101000
11110101110000101000 11110101110000101000 ....  Thus, it can't be
exactly represented as a float.




More information about the Python-list mailing list