Emanuel Barry added the comment:
This is due to how floating point numbers are handled under the hood. See
http://effbot.org/pyfaq/why-are-floating-point-calculations-so-inaccurate.htm
and https://docs.python.org/3/tutorial/floatingpoint.html for some useful read
about why Python behaves like
New submission from good.bad:
print(1 - 0.8)
0.19996
print(1 - 0.2)
0.8
why not 0.2?
--
messages: 259622
nosy: goodbad
priority: normal
severity: normal
status: open
title: Floating-point arithmetic
versions: Python 3.5
___
Python tracker