Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

0**0 should raise an error #45802

Closed
jmgillet mannequin opened this issue Nov 19, 2007 · 3 comments
Closed

0**0 should raise an error #45802

jmgillet mannequin opened this issue Nov 19, 2007 · 3 comments
Labels
interpreter-core (Objects, Python, Grammar, and Parser dirs) type-bug An unexpected behavior, bug, or error

Comments

@jmgillet
Copy link
Mannequin

jmgillet mannequin commented Nov 19, 2007

BPO 1461
Nosy @gvanrossum

Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

Show more details

GitHub fields:

assignee = None
closed_at = <Date 2007-11-19.17:21:36.378>
created_at = <Date 2007-11-19.10:46:53.949>
labels = ['interpreter-core', 'type-bug']
title = '0**0 should raise an error'
updated_at = <Date 2007-11-19.17:21:36.358>
user = 'https://bugs.python.org/jmgillet'

bugs.python.org fields:

activity = <Date 2007-11-19.17:21:36.358>
actor = 'gvanrossum'
assignee = 'none'
closed = True
closed_date = <Date 2007-11-19.17:21:36.378>
closer = 'gvanrossum'
components = ['Interpreter Core']
creation = <Date 2007-11-19.10:46:53.949>
creator = 'jmgillet'
dependencies = []
files = []
hgrepos = []
issue_num = 1461
keywords = []
message_count = 3.0
messages = ['57631', '57632', '57640']
nosy_count = 2.0
nosy_names = ['gvanrossum', 'jmgillet']
pr_nums = []
priority = 'normal'
resolution = 'wont fix'
stage = None
status = 'closed'
superseder = None
type = 'behavior'
url = 'https://bugs.python.org/issue1461'
versions = ['Python 2.5']

@jmgillet jmgillet mannequin added the type-bug An unexpected behavior, bug, or error label Nov 19, 2007
@jmgillet
Copy link
Mannequin Author

jmgillet mannequin commented Nov 19, 2007

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

@jmgillet jmgillet mannequin added the interpreter-core (Objects, Python, Grammar, and Parser dirs) label Nov 19, 2007
@jmgillet
Copy link
Mannequin Author

jmgillet mannequin commented Nov 19, 2007

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 :-)

@gvanrossum
Copy link
Member

Right.

@ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
interpreter-core (Objects, Python, Grammar, and Parser dirs) type-bug An unexpected behavior, bug, or error
Projects
None yet
Development

No branches or pull requests

1 participant