Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
>>> 0.1 + 0.2 == 0.3
False
>>> def compare(a, b, epsilon=0.00001):
... return abs(a - b) < epsilon
...
>>> compare(0.1 + 0.2, 0.3)
True
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.