Mathematics in Python are not correct

Terry Reedy tjreedy at udel.edu
Thu May 8 20:39:38 EDT 2008


"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






More information about the Python-list mailing list