Skip to content

Instantly share code, notes, and snippets.

@camelcaseblog
Created January 29, 2019 07:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save camelcaseblog/6253473b6b884b4452b1db98873e6146 to your computer and use it in GitHub Desktop.
Save camelcaseblog/6253473b6b884b4452b1db98873e6146 to your computer and use it in GitHub Desktop.
>>> from fractions import Fraction
>>> a = Fraction(1, 10)
>>> b = Fraction(2, 10)
>>> float(a + b)
0.3
>>> a + b == Fraction(3, 10)
True
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment