Mark Dickinson added the comment:
It might also help to note that, with decimal, what you see (from repr() of a
Decimal instance) is *exactly* what you get. So when you see
>>> dec
Decimal('1.797693134862315907729305191E+308')
that number really is exactly what's stored in dec: there are no
Mark Dickinson added the comment:
You don't say what behaviour you were expecting! :)
By design, almost all Decimal operations (but not creation of a Decimal from an
integer or string) round to the precision given by the current context. By
default that precision is 28 significant digits.
New submission from parmax :
>>> from decimal import Decimal
>>> dec = Decimal(2 ** 1024)
>>> dec
Decimal('1797693134862315907729305190789024733617976978942306572734300811577326758055009631327084773224075360211201138798713933576587897688144166224928474306394741243777678934248654852763022196012460