-
-
Notifications
You must be signed in to change notification settings - Fork 31.7k
assertion error in complex division #66794
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
This only happens in debug mode: >>> complex(0.0, 0.0) / complex(float('nan'), 0.0)
python: Objects/complexobject.c:98: _Py_c_quot: Assertion `b.imag != 0.0' failed. In release mode, this gives: >>> complex(0.0, 0.0) / complex(float('nan'), 0.0)
(nan+nanj) (is it the right result?) |
I think it is the right result. >>> 0.0 / float('nan')
nan |
Here is a patch. |
Patch LGTM.
Difficult to tell :-). Complex arithmetic in general isn't well standardised. Annex G of the C standard is about as close I've seen. But it doesn't look terribly wrong. |
New changeset 0c8f45caf697 by Antoine Pitrou in branch '3.4': New changeset af0104aed5b1 by Antoine Pitrou in branch 'default': New changeset cd4ecaf38283 by Antoine Pitrou in branch '2.7': |
Ok, I've committed the patch. Let's just see if the buildbots behave. |
They seem to have behaved! Congratulations, buildbots! |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: