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 mark.dickinson
Recipients eric.smith, lemburg, mark.dickinson, pitrou, stutzbach, vstinner
Date 2014-10-03.09:40:14
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1412329214.77.0.0175784349285.issue22544@psf.upfronthosting.co.za>
In-reply-to
Content
I think this is mostly unavoidable: cmath.log(z, 10) is a compound operation that does the equivalent of cmath.log(z) / cmath.log(10), while cmath.log10 is doing everything at once.

If anything, this is a problem in how complex division is done: it's arguable that division by a complex number with zero imaginary part should be special-cased here.

>>> inf = float('inf')
>>> z = complex(-0.0, -inf)
>>> cmath.log(10)
(2.302585092994046+0j)
>>> cmath.log(z)
(inf-1.5707963267948966j)
>>> cmath.log(z) / cmath.log(10)
(inf+nanj)

A simpler example just involving division:

>>> complex(2.0, inf) / 2.0   # expect 1 + infj.
(nan+infj)
History
Date User Action Args
2014-10-03 09:40:14mark.dickinsonsetrecipients: + mark.dickinson, lemburg, pitrou, vstinner, eric.smith, stutzbach
2014-10-03 09:40:14mark.dickinsonsetmessageid: <1412329214.77.0.0175784349285.issue22544@psf.upfronthosting.co.za>
2014-10-03 09:40:14mark.dickinsonlinkissue22544 messages
2014-10-03 09:40:14mark.dickinsoncreate