This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: Exponent function bug
Type: behavior Stage: resolved
Components: IDLE Versions: Python 3.6
process
Status: closed Resolution: not a bug
Dependencies: Superseder:
Assigned To: Nosy List: bhaskar, r.david.murray
Priority: normal Keywords:

Created on 2015-06-29 10:19 by bhaskar, last changed 2022-04-11 14:58 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
pythonabc.png bhaskar, 2015-06-29 10:19 please check the output of different -ve exponents
pythonabc.png bhaskar, 2015-06-29 10:19
Messages (2)
msg245928 - (view) Author: bhaskar (bhaskar) Date: 2015-06-29 10:19
the value of a -ve number when raised by a power of even number always results in a +ve number. I tried it with -1**10 , -1**2, -9**4

these all are resulting in -ve numbers which is mathematically incorrect.

ps. the same example is in the attachment
msg245929 - (view) Author: R. David Murray (r.david.murray) * (Python committer) Date: 2015-06-29 10:53
This bit of python's precedence rules often catches people by surprise.  ** binds tighter than -, so what python is evaluating is -(1**10).
History
Date User Action Args
2022-04-11 14:58:18adminsetgithub: 68714
2015-06-29 10:53:33r.david.murraysetstatus: open -> closed

type: compile error -> behavior

nosy: + r.david.murray
messages: + msg245929
resolution: not a bug
stage: resolved
2015-06-29 10:19:44bhaskarsetfiles: + pythonabc.png
2015-06-29 10:19:03bhaskarcreate