Floating point "g" format not stripping trailing zeros

Grant Edwards invalid at invalid.invalid
Fri Feb 13 09:02:03 EST 2015


On 2015-02-12, Ian Kelly <ian.g.kelly at gmail.com> wrote:
> On Thu, Feb 12, 2015 at 1:23 PM, Hrvoje Nikšić <hniksic at gmail.com> wrote:
>
>> {:.15g} is supposed to give 15 digits of precision, but with trailing
>> zeros removed.
>
> The doc says with "insignificant" trailing zeros removed, not all
> trailing zeros.

Can somebody explain the difference between "significant" and
"insignificant" tailing zeros to somebody who barely passed his single
numerical methods class?  [Though I have, on occasion, had to tinker
with the innards of SW floating point libraries and could fish a
hardcopy of IEEE-754 out of a filing cabinet if needed.]

-- 
Grant Edwards               grant.b.edwards        Yow! My polyvinyl cowboy
                                  at               wallet was made in Hong
                              gmail.com            Kong by Montgomery Clift!



More information about the Python-list mailing list