programming-examples/python/Math/Retrieve the current global context for all decimal.py
2019-11-15 12:59:38 +01:00

13 lines
440 B
Python

import decimal
context = decimal.getcontext()
print('Emax =', context.Emax)
print('Emin =', context.Emin)
print('capitals =', context.capitals)
print('prec =', context.prec)
print('rounding =', context.rounding)
print('flags =')
for x, y in context.flags.items():
print(' {}: {}'.format(x, y))
print('traps =')
for x, y in context.traps.items():
print(' {}: {}'.format(x, y))