On 8 Aug 2019, at 12:22, Richard Musil <risa2000x@gmail.com> 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> or the floating point section of the tutorial at <https://docs.python.org/3/tutorial/floatingpoint.html#tut-fp-issues>  for more information.

Ronald


Twitter: @ronaldoussoren
Blog: https://blog.ronaldoussoren.net/