float / rounding question

Mark Dickinson dickinsm at gmail.com
Sat Mar 8 01:12:34 CET 2008


On Mar 7, 5:12 pm, Piet van Oostrum <p... at cs.uu.nl> wrote:
> Python just uses the C library for printing, I presume, and the conversion
> routines in the C library are rather simplistic. It is, however, possible
> to do better, so that 53.6 -- although internally represented as something
> that could be described as 53.600000000000001 -- will actually be printed
> as 53.6.

There are issues with doing this portably and reliably.  See

http://bugs.python.org/issue1580

for a recent discussion.

Mark



More information about the Python-list mailing list