|
From: Raymond T. <toy...@gm...> - 2016-01-26 18:11:48
|
>>>>> "Richard" == Richard Fateman <fa...@be...> writes:
Richard> On 1/26/2016 1:44 AM, David Scherfgen wrote:
>> Hello,
>>
>> I'm getting very weird and inconsistent behavior when doing
>> float(exp(10000)) vs. float(exp(10000/3)) and float(exp(10000.0)).
>>
>> The first one works - the result is promoted to bigfloat.
Richard> This is a hack, and I suppose previously it overflowed. float() used to
Richard> convert to double-float machine
Richard> precision. Someone changed it to upgrade to bigfloat, i.e. make it the
Richard> same as bfloat() when needed.
Yes, this is a recent addition. I never really liked it because you
can get a bfloat by using bfloat().
>> The third one gives an error.
Richard> I think this one fails because exp(10000.0) overflows before float()
Richard> sees it.
Richard> Not a bug?
I agree. It's not a bug because you're explicitly asking for
exp(10000.0). But perhaps those in favor of returning a bigfloat in
the other cases will see this a a bug too.
--
Ray
|