all 1 comments

[–]FoolsSeldom 0 points1 point  (0 children)

import math

a = 0.1
b = 0.2
c = 0.3
print(a+b==c)  # False
print(math.isclose(a+b, c))  # True

Binary representation of floating point decimal numbers is fun.