Last active
January 29, 2019 12:24
-
-
Save camelcaseblog/519b5a370980b92e84a92309f50628ae to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
>>> 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