On 8 Aug 2019, at 12:22, Richard Musil email@example.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 : float(0.6441726684570313) Out: 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-calculation... 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.
Twitter: @ronaldoussoren Blog: https://blog.ronaldoussoren.net/