[issue15996] pow() for complex numbers is rough around the edges

2021-10-22 Thread Mark Dickinson
Mark Dickinson added the comment: See also discussion in #44970, which is closed as a duplicate of this issue. -- ___ Python tracker ___ __

[issue15996] pow() for complex numbers is rough around the edges

2021-10-21 Thread Terry J. Reedy
Terry J. Reedy added the comment: In Windows, I now get the Mark's macOS result instead of the Z.D.Error. >>> (1.0+0j)**(float('inf') + 0j) (nan+nanj) Has there been a revision of complex ** on another issue such that this one is obsolete? -- ___

[issue15996] pow() for complex numbers is rough around the edges

2013-10-13 Thread Raymond Hettinger
Raymond Hettinger added the comment: > OS math libraries are bad enough at *float* math, > let alone complex; I'd rather not depend on them unless we have to. This makes good sense. We should control how the special cases resolve and not be subject the whims of various C libraries.

[issue15996] pow() for complex numbers is rough around the edges

2013-10-13 Thread Mark Dickinson
Mark Dickinson added the comment: See also http://stackoverflow.com/q/18243270/270986 , which points out the following inconsistencies: >>> 1e300 ** 2 OverflowError: (34, 'Result too large') >>> 1e300j ** 2 OverflowError: complex exponentiation >>> (1e300 + 1j) ** 2 OverflowError: complex expon

[issue15996] pow() for complex numbers is rough around the edges

2012-09-23 Thread Jesús Cea Avión
Changes by Jesús Cea Avión : -- stage: -> test needed type: behavior -> enhancement ___ Python tracker ___ ___ Python-bugs-list maili

[issue15996] pow() for complex numbers is rough around the edges

2012-09-23 Thread Jesús Cea Avión
Changes by Jesús Cea Avión : -- nosy: +jcea stage: test needed -> type: enhancement -> behavior ___ Python tracker ___ ___ Python-bug

[issue15996] pow() for complex numbers is rough around the edges

2012-09-23 Thread Mark Dickinson
Mark Dickinson added the comment: Reclassifying this as an enhancement; I don't think it's appropriate to rewrite complex_pow for the bugfix releases. -- type: behavior -> enhancement versions: -Python 3.3 ___ Python tracker

[issue15996] pow() for complex numbers is rough around the edges

2012-09-22 Thread Mark Dickinson
Mark Dickinson added the comment: > (1.0+0j)**(float('inf') + 0j) Oddly enough, this is nan+nanj on OS X. I haven't investigated what the difference is due to---probably something to do with the errno results. -- ___ Python tracker

[issue15996] pow() for complex numbers is rough around the edges

2012-09-21 Thread Terry J. Reedy
Terry J. Reedy added the comment: Given that >>> 1.0**float('inf'), 1.0**float('-inf') (1.0, 1.0) works, >>> (1.0+0j)**(float('inf') + 0j) Traceback ... ZeroDivisionError: 0.0 to a negative or complex power (and same for ('-inf') seems like a clear bug in raising an exception, let alone a cle

[issue15996] pow() for complex numbers is rough around the edges

2012-09-21 Thread Mark Dickinson
Mark Dickinson added the comment: > C99 contains cpow. Perhaps we should use conditional compilation? I dread to think what horrors lurk in OS math library implementations of cpow; I suspect we'd soon find out, if we had used cpow and have any tests at all for special cases. OS math librarie

[issue15996] pow() for complex numbers is rough around the edges

2012-09-21 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: > Well, C99 covers pow for *real* numbers just fine; it's complex numbers > where no-one wants to pin down what the behaviour should be. C99 contains cpow. Perhaps we should use conditional compilation? -- ___ Py

[issue15996] pow() for complex numbers is rough around the edges

2012-09-21 Thread Mark Dickinson
Mark Dickinson added the comment: Well, C99 covers pow for *real* numbers just fine; it's complex numbers where no-one wants to pin down what the behaviour should be. So I don't think we need the man page reference. If we're writing tests for complex pow, we might also want to consider addin

[issue15996] pow() for complex numbers is rough around the edges

2012-09-21 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : -- nosy: +storchaka ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.p

[issue15996] pow() for complex numbers is rough around the edges

2012-09-20 Thread Alex Gaynor
Changes by Alex Gaynor : -- nosy: +alex ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/

[issue15996] pow() for complex numbers is rough around the edges

2012-09-20 Thread mattip
New submission from mattip: complex(1., 0.) ** complex(float('inf'), 0.) raises a ZeroDivisionError. In general, complex_power() needs to handle more corner cases. Barring a clear standard for pow() in C99, the documentation for pow 3 in glibc http://www.kernel.org/doc/man-pages/online/pages/ma