Created on 2014-10-10 15:35 by pitrou, last changed 2014-10-10 23:20 by pitrou. This issue is now closed.
| Files | ||||
|---|---|---|---|---|
| File name | Uploaded | Description | Edit | |
| c_quot_nan.patch | pitrou, 2014-10-10 17:33 | review | ||
| Messages (7) | |||
|---|---|---|---|
| msg229011 - (view) | Author: Antoine Pitrou (pitrou) * | Date: 2014-10-10 15:35 | |
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?)
|
|||
| msg229016 - (view) | Author: Serhiy Storchaka (serhiy.storchaka) * | Date: 2014-10-10 16:46 | |
I think it is the right result.
>>> 0.0 / float('nan')
nan
|
|||
| msg229019 - (view) | Author: Antoine Pitrou (pitrou) * | Date: 2014-10-10 17:33 | |
Here is a patch. |
|||
| msg229025 - (view) | Author: Mark Dickinson (mark.dickinson) * | Date: 2014-10-10 19:36 | |
Patch LGTM. > (is it the right result?) 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. |
|||
| msg229041 - (view) | Author: Roundup Robot (python-dev) | Date: 2014-10-10 21:57 | |
New changeset 0c8f45caf697 by Antoine Pitrou in branch '3.4': Issue #22604: Fix assertion error in debug mode when dividing a complex number by (nan+0j). https://hg.python.org/cpython/rev/0c8f45caf697 New changeset af0104aed5b1 by Antoine Pitrou in branch 'default': Issue #22604: Fix assertion error in debug mode when dividing a complex number by (nan+0j). https://hg.python.org/cpython/rev/af0104aed5b1 New changeset cd4ecaf38283 by Antoine Pitrou in branch '2.7': Issue #22604: Fix assertion error in debug mode when dividing a complex number by (nan+0j). https://hg.python.org/cpython/rev/cd4ecaf38283 |
|||
| msg229042 - (view) | Author: Antoine Pitrou (pitrou) * | Date: 2014-10-10 21:58 | |
Ok, I've committed the patch. Let's just see if the buildbots behave. |
|||
| msg229043 - (view) | Author: Antoine Pitrou (pitrou) * | Date: 2014-10-10 23:20 | |
They seem to have behaved! Congratulations, buildbots! |
|||
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2014-10-10 23:20:21 | pitrou | set | status: open -> closed resolution: fixed messages: + msg229043 stage: patch review -> resolved |
| 2014-10-10 21:58:19 | pitrou | set | messages: + msg229042 |
| 2014-10-10 21:57:43 | python-dev | set | nosy:
+ python-dev messages: + msg229041 |
| 2014-10-10 19:36:48 | mark.dickinson | set | messages: + msg229025 |
| 2014-10-10 17:33:33 | pitrou | set | files:
+ c_quot_nan.patch keywords: + patch messages: + msg229019 stage: patch review |
| 2014-10-10 16:46:00 | serhiy.storchaka | set | nosy:
+ serhiy.storchaka messages: + msg229016 |
| 2014-10-10 16:05:50 | ezio.melotti | set | nosy:
+ ezio.melotti |
| 2014-10-10 15:38:40 | vstinner | set | nosy:
+ vstinner |
| 2014-10-10 15:35:13 | pitrou | create | |