Floating point overflow and underflow

Shashank Tiwari shanky.tiwari at gmail.com
Tue Jan 7 22:48:45 EST 2020


Thanks everyone. Much appreciated.

On Tue, Jan 7, 2020, 7:46 PM Shashank Tiwari <shanky.tiwari at gmail.com>
wrote:

> Yes, I tried this and it worked. I was wondering if I could use the output
> of pow (or math.pow).
>
> On Tue, Jan 7, 2020, 7:41 PM Michael Torrie <torriem at gmail.com> wrote:
>
>> 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.
>> --
>> https://mail.python.org/mailman/listinfo/python-list
>>
>


More information about the Python-list mailing list