PyDocs

Nav

Numeric and Mathematical Modules

getcontext

decimal

function
  • getcontext()
Get the current default context.
1 Example
>>> from decimal import *
>>> getcontext()
Context(prec=28, rounding=ROUND_HALF_EVEN, Emin=-999999, Emax=999999,
        capitals=1, clamp=0, flags=[], traps=[Overflow, DivisionByZero,
        InvalidOperation])

>>> getcontext().prec = 7       # Set a new precision
from the Python docs
See Also
No see-alsos for decimal/getcontext
0 Notes
No notes for getcontext