[Python-Dev] PEP 3101: floats format 'f' and 'F' (original) (raw)

Mark Dickinson dickinsm at gmail.com
Wed Jul 16 17:51:39 CEST 2008


On Wed, Jul 16, 2008 at 4:15 PM, Eric Smith <eric+python-dev at trueblade.com> wrote:

There's no exponent until the number gets large. I haven't looked up how big the number has to get. On my Mac, it's somewhere between 1e50 and 1e60.

I think it's around 1e50, courtesy of the rather oddly-phrased line in unicodeobject.c (this is in py3k) that looks like:

if (type == 'f' && (fabs(x) / 1e25) >= 1e25)

In any case, I agree that the current 'F' is strange. Even after having read the relevant line of PEP 3101 several times in the past, part of my brain still believes that something formatted with 'F' should have all letters appearing in upper case.

Mark



More information about the Python-Dev mailing list