Mathematics in Python are not correct
Lou Pecora
pecora at anvil.nrl.navy.mil
Fri May 9 11:23:42 EDT 2008
In article <mailman.825.1210293599.12834.python-list at python.org>,
"Terry Reedy" <tjreedy at udel.edu> wrote:
> "Luis Zarrabeitia" <kyrie at uh.cu> wrote in message
> news:200805081914.06459.kyrie at uh.cu...
> | Btw, there seems to be a math problem in python with exponentiation...
> | >>> 0**0
> | 1
> | That 0^0 should be a nan or exception, I guess, but not 1.
>
> a**b is 1 multiplied by a, b times. 1 multiplied by 0 no times is 1.
> But there are unenlighted people who agree with you ;-)
> Wikipedia has a discussion of this.
>
> tjr
I like that argument better. But...
I've also heard the very similar a**b is a multiplied by a b-1 times.
That gives 0**0=0*(1/0). Uh, Oh! If you want consistency with the
treatment of exponents that might cause problems. Tough situation when
you have a "discontinuity" at 0 for x^x.
--
-- Lou Pecora
More information about the Python-list
mailing list