Message228319
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) |
|
Date |
User |
Action |
Args |
2014-10-03 09:40:14 | mark.dickinson | set | recipients:
+ mark.dickinson, lemburg, pitrou, vstinner, eric.smith, stutzbach |
2014-10-03 09:40:14 | mark.dickinson | set | messageid: <1412329214.77.0.0175784349285.issue22544@psf.upfronthosting.co.za> |
2014-10-03 09:40:14 | mark.dickinson | link | issue22544 messages |
2014-10-03 09:40:14 | mark.dickinson | create | |
|