decimal.getcontext()


Introduction
The function can change the default context set in Python.

Example
import decimal
x=decimal.Decimal(.11)
y=decimal.Decimal(.992)
print(x*y)
decimal.getcontext().prec=11
print(x*y)

Output
>>> 
0.1091199999999999997690736109
0.10912000000
>>> 

Comments