[issue24438] Strange behaviour when multiplying imaginary inf by 1

2015-06-12 Thread Mark Dickinson
Mark Dickinson added the comment: Closing as not a bug; for the suggestion of changing the mixed-type arithmetic behaviour, I think that's something that should be discussed on the python-ideas mailing list. -- resolution: -> not a bug stage: -> resolved status: open -> closed

[issue24438] Strange behaviour when multiplying imaginary inf by 1

2015-06-12 Thread Mark Dickinson
Mark Dickinson added the comment: There's no bug here: as Steven explained, this is simply the result of the usual arithmetic conversions when performing a mixed-type operation. > Python should multiply a complex by a non-complex in the "simple" way I think this would just be adding unnecessa

[issue24438] Strange behaviour when multiplying imaginary inf by 1

2015-06-12 Thread Steven D'Aprano
Steven D'Aprano added the comment: I've found the same behaviour going back to Python 1.5. I think what happens here is that (0+∞j)*1 evaluates the multiplication by implicitly coercing the int to a complex: (0+∞j)*(1+0j) => (0*1 + ∞j*1 + 0*0j + ∞j*0j) => (0-NAN + ∞j+0j) => (NA

[issue24438] Strange behaviour when multiplying imaginary inf by 1

2015-06-12 Thread R. David Murray
Changes by R. David Murray : -- nosy: +mark.dickinson ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://m

[issue24438] Strange behaviour when multiplying imaginary inf by 1

2015-06-12 Thread Alex Monk
New submission from Alex Monk: alex@alex-laptop:~$ python3 Python 3.4.3 (default, Mar 26 2015, 22:03:40) [GCC 4.9.2] on linux Type "help", "copyright", "credits" or "license" for more information. >>> infj = complex(0, float("inf")) >>> infj infj >>> infj*1 (nan+infj) >>> infj*1*1 (nan+nanj) --