decimal

Run Settings
LanguagePython
Language Version
Run Command
import decimal from decimal import Decimal # Correctly importing Decimal from decimal module # Creating a Decimal object using the tuple form: (sign, digits, exponent) print(Decimal((0, (3, 1, 4, 1, 5), -4))) # Prints 0.31415 a= Decimal('0.12345') b= Decimal('0.12345') print(a+b) with decimal.localcontext() as ctx: ctx.prec = 2 c= a + b print('c within local context: {0}'.format(c)) print('c whthin global context: {0}'.format(c)) c = c+b print(c) print(globals())
Editor Settings
Theme
Key bindings
Full width
Lines