Floating point printing is tricky, as I am sure you know. You might
want to refrefresh your understanding by consulting the literture--I
know I would. For example, you might want to look at
http://portal.acm.org/citation.cfm?id=93559
Guy Steele's paper:
Guy L. Steele , Jon L. White, H
[Georg Brandl]
> ...
> Reviewing the printf man page, this is okay since for %f, the precision is the
> number of digits after the decimal point while for %g, it is the number of
> significant digits. Still, that should be documented in the Python manual.
Well, there are a lot of little details in
Georg Brandl wrote:
> Is there a reason why the "alternate format" isn't documented for float
> conversions in http://docs.python.org/lib/typesseq-strings.html ?
>
> '%#8.f' % 1.0 keeps the decimal point while '%8.f' % 1.0 drops it.
>
> Also, for %g the alternate form keeps trailing zeroes.
>
>
Is there a reason why the "alternate format" isn't documented for float
conversions in http://docs.python.org/lib/typesseq-strings.html ?
'%#8.f' % 1.0 keeps the decimal point while '%8.f' % 1.0 drops it.
Also, for %g the alternate form keeps trailing zeroes.
While at it, I noticed a difference