pow(-1,0) = 1, -1**0 = -1, why?

Kirby Urner urner at alumni.princeton.edu
Tue Dec 19 14:12:17 EST 2000


Kirby Urner <urner at alumni.princeton.edu> wrote:

>
> Python 2.0 (#8, Oct 16 2000, 17:27:58) [MSC 32 bit (Intel)] on win32
> Type "copyright", "credits" or "license" for more information.
> IDLE 0.6 -- press F1 for help
> 
> >>> -1**0
> -1

But (-1)**0 = 1.

Slaps forehead, duh!

Thanks Joe!, I'll sleep better now. 

-- Kirby





More information about the Python-list mailing list