gh-119372: Recover inf's and zeros in _Py_c_quot (GH-119457) · python/cpython@2cb84b1 · GitHub
Skip to content

Commit 2cb84b1

Browse files
authored
gh-119372: Recover inf's and zeros in _Py_c_quot (GH-119457)
In some cases, previously computed as (nan+nanj), we could recover meaningful component values in the result, see e.g. the C11, Annex G.5.2, routine _Cdivd().
1 parent 0a1e8ff commit 2cb84b1

3 files changed

Lines changed: 56 additions & 2 deletions

File tree

Lib/test/test_complex.py

Lines changed: 31 additions & 0 deletions
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Correct invalid corner cases in complex division (resulted in ``(nan+nanj)``
2+
output), e.g. ``1/complex('(inf+infj)')``. Patch by Sergey B Kirpichev.

Objects/complexobject.c

Lines changed: 23 additions & 2 deletions

0 commit comments

Comments
 (0)