[issue22544] Inconsistent cmath.log behaviour

2016-09-09 Thread Mark Dickinson
Mark Dickinson added the comment: Closing as "won't fix". Two-argument log is already a rather unnatural beast to have in the cmath module, and I find it hard to imagine any real-world use-case caring about what happens for two-argument complex log applied to infinities or nans. -- re

[issue22544] Inconsistent cmath.log behaviour

2015-04-27 Thread STINNER Victor
Changes by STINNER Victor : -- nosy: -haypo ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.pytho

[issue22544] Inconsistent cmath.log behaviour

2015-04-26 Thread Mark Dickinson
Mark Dickinson added the comment: Per: yes, that's true. I don't think changing either division or multiplication is the way forward for this issue, though; I'd rather implement the less invasive change where `cmath.log` special-cases the situation where its second argument is real and positiv

[issue22544] Inconsistent cmath.log behaviour

2015-04-25 Thread Per Brodtkorb
Per Brodtkorb added the comment: This is not only a problem for division. It also applies to multiplication as exemplified here: >>> complex(0,inf)+1 # expect 1 + infj Out[16]: (1+infj) >>> (complex(0,inf)+1)*1 # expect 1 + infj Out[17]: (nan+infj) >>> complex(inf, 0) + 1j # expect inf + 1

[issue22544] Inconsistent cmath.log behaviour

2014-10-03 Thread Mark Dickinson
Changes by Mark Dickinson : -- assignee: -> mark.dickinson ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: htt

[issue22544] Inconsistent cmath.log behaviour

2014-10-03 Thread Mark Dickinson
Mark Dickinson added the comment: One other option that doesn't involve changing the behaviour of complex division would be to special-case `cmath.log` in the case when the second argument is a float or an int. -- ___ Python tracker

[issue22544] Inconsistent cmath.log behaviour

2014-10-03 Thread Mark Dickinson
Mark Dickinson added the comment: 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

[issue22544] Inconsistent cmath.log behaviour

2014-10-03 Thread STINNER Victor
Changes by STINNER Victor : -- nosy: +haypo ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python

[issue22544] Inconsistent cmath.log behaviour

2014-10-03 Thread Antoine Pitrou
New submission from Antoine Pitrou: >>> inf = float('inf') >>> z = complex(-0.0, -inf) >>> cmath.log(z) (inf-1.5707963267948966j) >>> cmath.log10(z) (inf-0.6821881769209206j) >>> cmath.log(z, 10) (inf+nan*j) -- components: Library (Lib) messages: 228307 nosy: eric.smith, lemburg, mark.di