Mathematics in Python are not correct

Mark Dickinson dickinsm at gmail.com
Mon May 12 12:38:06 EDT 2008


On May 12, 11:15 am, Arnaud Delobelle <arno... at googlemail.com> wrote:

> But exp(y*log(x)) -> 1 as (x, y) -> (0, 0) along any analytic curve
> which is not the x=0 axis (I think at least - it seems easy to prove
> that given f and g analytic over R, f(x)*ln g(x) -> 0 as x -> 0 if
> f(0)=g(0)=0 and g(x)>0 in the neighbourhood of 0).

Agreed.  And this makes an excellent argument that if you're going to
choose a number for 0.0**0.0 then it's got to be 1.  But I still don't
find it completely convincing as an argument that 0.0**0.0 should be
defined at all.

> This should cover most practical uses?

Maybe.  But if you're evaluating x**y in a situation where x and y
represent physical quantities, or otherwise have some degree of error,
then you probably want to be warned if x and y both turn out to be
zero.


I seem to be digging myself into a hole here.  I'm personally
firmly in the "0**0 should be 1" camp, and always have been---
there are just too many practical benefits to defining 0**0==1
to ignore, and in the case where you're interested in integer
exponents anything else is just plain wrong. The lack of
continuity of the power function at (0,0) seems a small
price to pay.

Mark



More information about the Python-list mailing list