Floating point overflow and underflow

Michael Torrie torriem at gmail.com
Tue Jan 7 22:40:55 EST 2020


On 1/7/20 8:18 PM, Shashank Tiwari wrote:
> Thanks Chris. What if it's pow(2.2,0.45)?

Why not do some more experimentation:

>>> import decimal
>>> a = decimal.Decimal('2.2')
>>> b = decimal.Decimal('0.45')
>>> a ** b
Decimal('1.425903734234490793207619170')

Is this what you mean? I'm sure there are other ways as well.


More information about the Python-list mailing list