mathematics localcontext([ ]creates context manager that sets the current decimal context to copy of for statements defined inside the body of with statement if is omitteda copy of the current context is created here is an example of using this function that temporarily sets the precision to five decimal places for series of statementswith localcontext(as cc prec statements setcontext(csets the decimal context of the calling thread to basiccontext premade context with nine digits of precision rounding is round_half_upemin is - emax is and all traps are enabled except for inexactroundedand subnormal defaultcontext the default context used when creating new contexts (the values stored here are used as default values for the new contextdefines digits of precisionround_half_even roundingand traps for overflowinvalidoperationand divisionbyzero extendedcontext premade context with nine digits of precision rounding is round_half_evenemin is - emax is and all traps are disabled never raises exceptions insteadresults may be set to nan or infinity inf the same as decimal("infinity"neginf the same as decimal("-infinity"nan the same as decimal("nan"examples here are some more examples showing basic usage of decimal numbersa decimal(" " decimal(" " decimal(" " decimal(" "divmod( , (decimal(" ")decimal(" ")max( ,bdecimal(" " [decimal(" ")decimal(" ")decimal(" ")sum(cdecimal(" " lib fl ff