Created
April 8, 2013 07:36
-
-
Save philippbayer/5334931 to your computer and use it in GitHub Desktop.
Tiny comparison float() vs. +0.0
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
>>python -m timeit "100 + 0.0" | |
10000000 loops, best of 3: 0.0217 usec per loop | |
>>python -m timeit "float(100)" | |
10000000 loops, best of 3: 0.17 usec per loop |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment