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 <>
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)
>>> cmath.log(z)
>>> cmath.log(z) / cmath.log(10)

A simpler example just involving division:

>>> complex(2.0, inf) / 2.0   # expect 1 + infj.
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: <>
2014-10-03 09:40:14mark.dickinsonlinkissue22544 messages
2014-10-03 09:40:14mark.dickinsoncreate