First page Back Continue Last page Overview Graphics
Performing Arithmetic
There's astonishingly little to learn here:
>>> import decimal
>>> x = decimal.Decimal('1.3')
>>> y = x + x
>>> y
Decimal("2.6")
>>> z = x * y
>>> z
Decimal("3.38")
>>> a = z - y
>>> a
Decimal("0.78")
Notes:
Performing arithmatic is remarkably uninteresting. You just use Python's basic operators: Plus, Minus, Times...