[issue1580] Use shorter float repr when possible

Guido van Rossum report at bugs.python.org
Tue Dec 11 16:21:20 CET 2007


Guido van Rossum added the comment:

(1) Despite Tim's grave language, I don't think we'll need to write our
own correctly-rounding float input routine.  We can just say that Python
won't work correctly unless your float input routine is rounding
correctly; a unittest should detect whether this is the case.  I expect
that more recent C runtimes for Windows are correct.

(1a) Perhaps it's better to only do this for Python 3.0, which has a
smaller set of platforms to support.

(2) Have you two (Christian and Noam) figured out yet why repr(1e5) is
'1.0' on some platforms?  If it's not byte order (and I no longer
believe it is) what could it be?  An uninitialized variable?  It doesn't
seem to vary with the processor, but it could vary with the C runtime or OS.

(3) Detecting NaNs and infs in a platform-independent way is tricky,
probably beyond you (I know it's beyond me).  (Of course, producing
standardized output for them and recognizing these as input is easy, and
that should definitely be done.)

(4) Looks like we've been a bit too hasty checking this in.  Let's be
extra careful for round #2.

__________________________________
Tracker <report at bugs.python.org>
<http://bugs.python.org/issue1580>
__________________________________


More information about the Python-bugs-list mailing list