In article <[EMAIL PROTECTED]>,
 "Terry Reedy" <[EMAIL PROTECTED]> wrote:

> "Lou Pecora" <[EMAIL PROTECTED]> wrote in message 
> news:[EMAIL PROTECTED]
> | In article <[EMAIL PROTECTED]>,
> | "Terry Reedy" <[EMAIL PROTECTED]> wrote:
> |
> | > "Luis Zarrabeitia" <[EMAIL PROTECTED]> wrote in message
> | > news:[EMAIL PROTECTED]
> | > | 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.
> 
> Me too, in school, but *that* definition is incomplete: it excludes b=0 and 
> hence a**0 for all a.  It was the best people could do before 0 was known.
> But 0 was introduced to Europe just over 800 years ago ;-)

[cut some interesting examples]

Yes, I was also thinking about the b=0 case and then the case when b<0.  
If you solve the b<0 case, you solve the b=0 case for a !=0.  Define

a**b= a multiplied by 1/a |b-1| times when b<0.  Then for b=0 we get 
a*(1/a)=1.

Of course, I can avoid all this mathematical dancing around by using 
some of the other simpler definitions like the original one.  :-)

-- 
-- Lou Pecora
--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to