[Python-bugs-list] [ python-Bugs-533198 ] Complex power underflow raises exception

noreply@sourceforge.net noreply@sourceforge.net
Thu, 21 Mar 2002 11:20:27 -0800


Bugs item #533198, was opened at 2002-03-21 12:26
You can respond by visiting: 
http://sourceforge.net/tracker/?func=detail&atid=105470&aid=533198&group_id=5470

Category: Python Interpreter Core
Group: Python 2.2.1 candidate
Status: Open
Resolution: None
Priority: 5
Submitted By: Konrad Hinsen (hinsen)
Assigned to: Nobody/Anonymous (nobody)
Summary: Complex power underflow raises exception

Initial Comment:
Python 2.2.1c1 (#1, Mar 19 2002, 12:10:26) 
[GCC 2.96 20000731 (Red Hat Linux 7.1 2.96-85)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> (0.01+0.01j)**200
Traceback (most recent call last):
  File "<stdin>", line 1, in ?
ValueError: 0.0 to a negative or complex power


I could trace this back to the routine c_pow() in complexobject.c. It explicitly sets ERANGE for the case that it quoted in the error message, but in my example, ERANGE is set by pow() in line 140 of complexobject.c.

The problem disappears if I link Python with -lieee under Linux, but after the recent discussion I had the impression that Python is not supposed to use -lieee under Linux, for whatever reason.


----------------------------------------------------------------------

>Comment By: Tim Peters (tim_one)
Date: 2002-03-21 14:20

Message:
Logged In: YES 
user_id=31435

1. Konrad, this isn't a *new* problem, right?  That is, 
this code hasn't changed in ages.  I'd expect it to fail 
the same way in, e.g., 2.1.

2. I know of no reason to avoid -lieee.  Someone checked in 
a patch to stop linking with it sometimes, but the reason 
for the change wasn't recorded.  People do lots of random 
stuff <0.5 wink>.  If you find a sensible reason to avoid 
it, let me know.

----------------------------------------------------------------------

You can respond by visiting: 
http://sourceforge.net/tracker/?func=detail&atid=105470&aid=533198&group_id=5470