> On 8 Aug 2019, at 12:22, Richard Musil <[email protected]> wrote:
>
> I have found myself in an awkward situation with current (Python 3.7) JSON
> module. Basically it boils down to how it handles floats. I had been hit on
> this particular case:
>
> In [31]: float(0.6441726684570313)
> Out[31]: 0.6441726684570312
>
> but I guess it really does not matter.
It really doesn’t, both values have the same binary representation. See the
Python FAQ at
<https://docs.python.org/3/faq/design.html#why-are-floating-point-calculations-so-inaccurate
<https://docs.python.org/3/faq/design.html#why-are-floating-point-calculations-so-inaccurate>>
or the floating point section of the tutorial at
<https://docs.python.org/3/tutorial/floatingpoint.html#tut-fp-issues
<https://docs.python.org/3/tutorial/floatingpoint.html#tut-fp-issues>> for
more information.
Ronald
—
Twitter: @ronaldoussoren
Blog: https://blog.ronaldoussoren.net/
_______________________________________________
Python-ideas mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3/lists/python-ideas.python.org/
Message archived at
https://mail.python.org/archives/list/[email protected]/message/6U55O55HTG3PMYRIHX5HE5BMJKGXPGGF/
Code of Conduct: http://python.org/psf/codeofconduct/