GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | |||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | |||||||||||||
GeezerVison is showing github.com — gh-156693: correct complex powers with infinite bases by skirpichev · Pull Request #156694 · python/cpython Conversation
|
|
CC @hpkfft |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
|
A Python core developer has requested some changes be made to your pull request before we can consider merging it. If you could please address their requests along with any other requests in other reviews from core developers that would be appreciated. Once you have made the requested changes, please leave a comment on this pull request containing the phrase |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
I have made the requested changes; please review again |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Thanks for making the requested changes! @eendebakpt: please review the changes made to this pull request. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
One more caseswhere the behavior changes: (1e-200+0j)**-2 (it would not happen under #156695, but that is not merged yet).
And can you add a test for complex(inf)**1j?
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
…e-156693.BuDcDc.rst Co-authored-by: Pieter Eendebak <[email protected]>
Indeed, I believe now all should be fixed. I'll not add a test, though, because this behavior can be changed by #156695.
Done. Last commit removes special handling for some corner cases, that's optional. Let me know if you prefer to keep this. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
8e7ff19 to
935b0e6
Compare
|
With your latest iteration: what about |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
In my opinion, anybody calling You're welcome to look at my work-in-progress: hpkfft#1 |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
…int arithmetics)" This reverts commit 935b0e6.
Anyone, calling We decided to not provide low-level primitives, that works same as complex arithmetics in the Python. You can use either
Thanks, but I'll try to limit this PR just for a bugfix. IMO, cleanest alternative to using |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Ah, it seems that added BTW, I'm not sure that ZeroDivisionError is a right thing here. On latest gmpy2: >>> from gmpy2 import * >>> get_context().trap_divzero = True >>> mpc('inf')**mpc(1j) mpc('nan+nanj') >>> get_context() context(precision=53, real_prec=Default, imag_prec=Default, round=RoundToNearest, real_round=Default, imag_round=Default, emax=1073741823, emin=-1073741823, subnormalize=False, trap_underflow=False, underflow=False, trap_overflow=False, overflow=False, trap_inexact=False, inexact=False, trap_invalid=False, invalid=True, trap_erange=False, erange=False, trap_divzero=True, divzero=False, allow_complex=False, rational_division=False, allow_release_gil=False) |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
My preference would be ZeroDivisionError only if base is zero and exp is not a positive real number. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Opened #156886 for ZeroDivisionError. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
@skirpichev Do you plan to followup on this PR? Some of the added tests seem worthwhile to have in any case. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
All are about corner cases, with special components (like inf or zero). We have a dedicated issue #60200 about that.
Let me know if you think it worth to add predicates ( |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
There was an error while loading. Please reload this page.