classification
Title: 0**0 should raise an error
Type: behavior Stage:
Components: Interpreter Core Versions: Python 2.5
process
Status: closed Resolution: wont fix
Dependencies: Superseder:
Assigned To: Nosy List: gvanrossum, jmgillet
Priority: normal Keywords:

Created on 2007-11-19 10:46 by jmgillet, last changed 2007-11-19 17:21 by gvanrossum. This issue is now closed.

Messages (3)
msg57631 - (view) Author: Jean-Marc Gillet (jmgillet) Date: 2007-11-19 10:51
The result is actually undefined, as x**0 gives 1 and 0**x gives 0.

Python 2.5.1 (r251:54863, Apr 18 2007, 08:51:08) [MSC v.1310 32 bit
(Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> 1**0
1
>>> 0**1
0
>>> 0**0
1
msg57632 - (view) Author: Jean-Marc Gillet (jmgillet) Date: 2007-11-19 11:37
See http://en.wikipedia.org/wiki/Exponentiation "Zero to the zero
power". There are pros and cons of 0**0==1 so if you mark this one as
"wontfix" I promise not to bother you again :-)
msg57640 - (view) Author: Guido van Rossum (gvanrossum) * (Python committer) Date: 2007-11-19 17:21
Right.
History
Date User Action Args
2007-11-19 17:21:36gvanrossumsetstatus: open -> closed
resolution: wont fix
messages: + msg57640
nosy: + gvanrossum
2007-11-19 11:37:30jmgilletsetmessages: + msg57632
2007-11-19 10:51:04jmgilletsetmessages: + msg57631
components: + Interpreter Core
versions: + Python 2.5
2007-11-19 10:46:59jmgilletcreate