[Python-Dev] PEP 3101: floats format 'f' and 'F'

Daniel Stutzbach daniel at stutzbachenterprises.com
Wed Jul 16 17:14:23 CEST 2008


On Wed, Jul 16, 2008 at 10:07 AM, Mark Dickinson <dickinsm at gmail.com> wrote:
> On Wed, Jul 16, 2008 at 3:35 PM, Eric Smith
> <eric+python-dev at trueblade.com> wrote:
>> Does anyone know why 'F' is the same as 'f'?  Wouldn't it make more sense to
>> either drop it, or make it convert the exponent to upper case
>
> What exponent?  Isn't the point of 'f' formatting that there is no exponent?

There's no exponent for small-magnitude numbers, but still an exponent
for large-magnitude numbers:

>>> '%f' % (10**100)
'1e+100'

-- 
Daniel Stutzbach, Ph.D. President, Stutzbach Enterprises LLC


More information about the Python-Dev mailing list