[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.

--
resolution:  -> wont fix
stage:  -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue22544] Inconsistent cmath.log behaviour

2015-04-27 Thread STINNER Victor

Changes by STINNER Victor victor.stin...@gmail.com:


--
nosy:  -haypo

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue22544
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 positive.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue22544
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 + 1j
Out[18]: (inf+1j)

 (complex(inf, 0)+1j)*1  # expect inf + 1j
Out[19]: (inf, nanj)

--
nosy: +pbrod
versions: +Python 2.7

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue22544
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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.dickinson, pitrou, stutzbach
priority: low
severity: normal
status: open
title: Inconsistent cmath.log behaviour
type: behavior
versions: Python 3.4, Python 3.5

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue22544
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue22544] Inconsistent cmath.log behaviour

2014-10-03 Thread STINNER Victor

Changes by STINNER Victor victor.stin...@gmail.com:


--
nosy: +haypo

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue22544
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 
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)

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue22544
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 rep...@bugs.python.org
http://bugs.python.org/issue22544
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue22544] Inconsistent cmath.log behaviour

2014-10-03 Thread Mark Dickinson

Changes by Mark Dickinson dicki...@gmail.com:


--
assignee:  - mark.dickinson

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue22544
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com