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: Error Evaluating float(x) ** float(y)
Type: behavior Stage:
Components: Interpreter Core Versions: Python 3.0
process
Status: closed Resolution: not a bug
Dependencies: Superseder:
Assigned To: Nosy List: exarkun, mark.dickinson
Priority: normal Keywords:

Created on 2009-06-03 13:20 by Zero, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Messages (3)
msg88808 - (view) Author: Stephen Paul Chappell (Zero) Date: 2009-06-03 13:19
This is what I get while the interactive interpreter (IDLE 3.0.1) on the 
platform
Python 3.0.1 (r301:69561, Feb 13 2009, 20:04:18) [MSC v.1500 32 bit 
(Intel)] on win32

>>> a = -6.276479035564047
>>> b = -5.7974497499584849
>>> a ** b != -6.276479035564047 ** -5.7974497499584849
True
>>> 

Something is wrong. The float values are the same but not evaluated as 
being equal.
After writing an automated testing program, these sample numbers were 
generated
and found  to create erroneous symptoms in the system being 
automatically tested.
msg88809 - (view) Author: Jean-Paul Calderone (exarkun) * (Python committer) Date: 2009-06-03 13:27
Have you checked to see what the result of a ** b is?
msg88811 - (view) Author: Mark Dickinson (mark.dickinson) * (Python committer) Date: 2009-06-03 13:30
This is not a bug:  Python's operator precedence rules mean that the 
expression

  -6.276479035564047 ** -5.7974497499584849

is treated as:

  -(6.276479035564047 ** -5.7974497499584849).

>>> a = -6.276479035564047
>>> b = -5.7974497499584849
>>> a ** b != -6.276479035564047 ** -5.7974497499584849
True
>>> a ** b == (-6.276479035564047) ** -5.7974497499584849
True
History
Date User Action Args
2022-04-11 14:56:49adminsetgithub: 50438
2019-10-31 14:23:36Zerosetnosy: - Zero
2009-06-03 13:30:48mark.dickinsonsetstatus: open -> closed

nosy: + mark.dickinson
messages: + msg88811

resolution: not a bug
2009-06-03 13:27:17exarkunsetnosy: + exarkun
messages: + msg88809
2009-06-03 13:20:01Zerocreate