1
It seems pretty obvious to us humans that 0.1 + 0.2 - 0.3 is 0 but why when I ask the Python interpreter to perform the following operation:
print(0.1 + 0.2 - 0.3)
he returns 5.55111512313e-17?
It’s something to do with the precision of floats?
You have a number of questions/answers here about this: https://answall.com/questions/5642, https://answall.com/questions/219211 , https://answall.com/questions/38138 ...
– Miguel
Related: Why in Python 0.03 % 0.01 = 0.009999999999998 and not 0?
– Wallace Maxters
Thanks @Miguel, I was in doubt if closed as duplicate, but there are several examples here talking about the IEEE 754.
– Wallace Maxters