programming-examples/python/Math/Retrieve the current global context for all decimal.py

13 lines
440 B
Python
Raw Normal View History

2019-11-15 12:59:38 +01:00
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))