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

Kirby Urner urner at alumni.princeton.edu
Tue Dec 19 13:44:16 EST 2000


 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
 >>> pow(-1,0)
 1
 >>> -10**0
 -1
 >>> pow(-10,0)
 1


These are inconsistent.  I think pow() is giving the right answer.

Kirby




More information about the Python-list mailing list