osdir.com


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Floating point overflow and underflow


Thanks Chris. What if it's pow(2.2,0.45)?

On Tue, Jan 7, 2020, 6:40 PM Chris Angelico <rosuav at gmail.com> wrote:

> 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
> --
> https://mail.python.org/mailman/listinfo/python-list
>