[Tim Peters]
>> ...
>> >>> (-math.inf) ** 3.1
>> inf

[David Mertz]
> Weird. I take it that's what IEEE-754 says. NaN would sure be more intuitive
> here since inf+inf-j is not in the domain of Reals. Well, technically
> neither is inf, but at least it's the limit of the domain. :-).

Mathematical reals have all sorts of properties floats fail to
capture, while mathematical reals don't distinguish between -0 and +0
at all.  "Practical' symmetry arguments often underlie what float
standards require.  At heart , the rules for infinite arguments are
often _consequences_ of "more obvious" rules for signed zero
arguments, following from replacing +-inf with 1/+-0 in the latter.

More explanation here:


But we're not required to _like_ it; we just have to implement it ;-)

>> >>> (-math.inf) ** 3.0 # NOTE THIS ONE
>> -inf
>> >>> (-math.inf) ** 2.9
>> inf
Python-Dev mailing list

Reply via email to