Skip to content

Instantly share code, notes, and snippets.

@j2labs
Created April 14, 2011 16:31
Show Gist options
  • Select an option

  • Save j2labs/919859 to your computer and use it in GitHub Desktop.

Select an option

Save j2labs/919859 to your computer and use it in GitHub Desktop.
>>> print "%0.20f" % (0.1 + 0.2)
0.30000000000000004441
>>> print "%0.30f" % (0.1 + 0.2)
0.300000000000000044408920985006
>>> print "%0.30f" % (0.2 + 0.2)
0.400000000000000022204460492503
>>> print "%0.30f" % (0.3 + 0.2)
0.500000000000000000000000000000
>>> print "%0.30f" % (0.3 + 0.3)
0.599999999999999977795539507497
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment