Floating point overflow and underflow

Chris Angelico rosuav at gmail.com
Tue Jan 7 21:39:20 EST 2020


On Wed, Jan 8, 2020 at 1:37 PM Shashank Tiwari <shanky.tiwari at gmail.com> wrote:
>
> Thanks Rob.
>
> How would one initialize a Decimal with something like pow(2,256)?
>

Easy, just initialize it with an integer:

>>> Decimal(2**256)
Decimal('115792089237316195423570985008687907853269984665640564039457584007913129639936')

ChrisA


More information about the Python-list mailing list