>>> from decimal import Decimal >>> a = 0.1 >>> b = 0.2 >>> c = float(Decimal(str(a)) + Decimal(str(b))) >>> c 0.3