John Holman added the comment:
Thanks - sorry to waste your time.
On Tue, 4 Jan 2022 at 18:17, Raymond Hettinger
wrote:
>
> Raymond Hettinger added the comment:
>
> The two numbers you gave become the same when rounded to the limited
> internal precision used by floats.
>
> >>>
Raymond Hettinger added the comment:
The two numbers you gave become the same when rounded to the limited internal
precision used by floats.
>>> 1.12345678901234 == 1.123456789011
True
When it comes to displaying the number, Python tries to show the shortest
possible member of the
New submission from John Holman :
Example:
str(1.12345678901234)
Out[24]: '1.123456789011'
shouldn't the last digit should be 2?
--
messages: 409696
nosy: johngholman
priority: normal
severity: normal
status: open
title: float formatting error?
type: behavior
versions: Python