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 Francesco Biscani, Saksham Agrawal, berker.peksag, eric.smith, ezio.melotti, lemburg, mark.dickinson, steven.daprano, stutzbach
Date 2015-10-21.18:04:53
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1445450693.68.0.697958161152.issue25453@psf.upfronthosting.co.za>
In-reply-to
Content
If the proposal is to add C99 Appendix G-style handling of nan+nanj results for complex multiplication, that doesn't seem unreasonable to me, though I'm not particularly convinced that the gain in complexity is worth it.  So -0 from me. Whatever happens, I'd hope that the complex multiplication operation 
remains simple and easily explainable, not degenerating into a mass of special cases.

I'd be opposed to adding special-case handing for float-by-complex multiplication (i.e., doing anything other than promoting the float to a complex by introducing a zero imaginary part, and then doing normal complex multiplication).  But I don't think that's what Francesco is proposing.

FWIW, NumPy semantics follow those of Python, though that's hardly an independent data point.

In answer to Steven, IEEE 754 has precisely nothing to say on this subject: it simply doesn't cover complex arithmetic.

Francesco: by the way, I'd be interested to see the C source that gave you `inf + nan*j` for this.  How did you initialise the arguments to the multiplication? C99 has a significant issue here (fixed in C2011), namely that there's no standard way to create a complex value with given real and imaginary parts.  (Using real_part + I*imaginary_part doesn't count, because in the absence of the Imaginary type, which few compilers seem to implement, the real part of the "I" constant mucks up the arithmetic w.r.t. infinities, NaNs and signed zeros.)
History
Date User Action Args
2015-10-21 18:04:53mark.dickinsonsetrecipients: + mark.dickinson, lemburg, eric.smith, stutzbach, ezio.melotti, steven.daprano, berker.peksag, Francesco Biscani, Saksham Agrawal
2015-10-21 18:04:53mark.dickinsonsetmessageid: <1445450693.68.0.697958161152.issue25453@psf.upfronthosting.co.za>
2015-10-21 18:04:53mark.dickinsonlinkissue25453 messages
2015-10-21 18:04:53mark.dickinsoncreate