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.

Author tim.peters
Recipients
Date 2002-03-22.02:51:42
SpamBayes Score
Marked as misclassified
Message-id
In-reply-to
Content
Logged In: YES 
user_id=31435

These are old bugs in complex_pow() and friends.  Please 
give current CVS a try!  Changes made in

Objects/complexobject.c; new revision: 2.55:

1. Raising 0 to a negative power isn't a range error, it's 
a domain error, so changed c_pow() to set errno to EDOM in
that case instead of ERANGE.

2. Changed complex_pow() to:

A. Use the Py_ADJUST_ERANGE2 macro to try to clear errno of
a spurious ERANGE error due to underflow in the libm pow()
called by c_pow().

B. Produce different exceptions depending on the errno
value:

i) For errno==EDOM, raise ZeroDivisionError instead of
ValueError.  This is for consistency with the non-complex 
cases 0.0**-2 and 0**-2 and 0L**-2.

ii) For errno==ERANGE, raise OverflowError.
History
Date User Action Args
2007-08-23 13:59:58adminlinkissue533198 messages
2007-08-23 13:59:58admincreate