Skip to content

Instantly share code, notes, and snippets.

@philippbayer
Created April 8, 2013 07:36
Show Gist options
  • Save philippbayer/5334931 to your computer and use it in GitHub Desktop.
Save philippbayer/5334931 to your computer and use it in GitHub Desktop.
Tiny comparison float() vs. +0.0
>>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