Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Changes from 1 commit
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
3980363
gh-69639: add mixed-mode rules for complex arithmetic (C-like)
skirpichev Apr 23, 2024
46521c3
address review:
skirpichev Oct 2, 2024
1323f4d
Update Objects/complexobject.c
skirpichev Oct 2, 2024
5021a9b
address review: -> real_to_double
skirpichev Oct 2, 2024
c7308ef
Add _Py_cd_* and _Py_dc_* functions
skirpichev Oct 2, 2024
ee1aa01
+ what's new
skirpichev Oct 2, 2024
da566dd
+ trying to document new coersion rules in the reference
skirpichev Oct 2, 2024
714b731
address review: expressions.rst
skirpichev Oct 3, 2024
7a04eb0
address review: reword what's new
skirpichev Oct 3, 2024
1d42c10
cleanup: just one macro
skirpichev Oct 4, 2024
d6e9d14
renamed c-api helpers: _dc_ -> _rc_ and _cd_ -> _cr_
skirpichev Oct 6, 2024
2db0072
1d42c10202 +1
skirpichev Oct 6, 2024
46bed69
+ tests for semi-private C-API
skirpichev Oct 6, 2024
d6e4504
Merge branch 'master' into complex-float-arith-69639
skirpichev Oct 6, 2024
cc298e5
Apply suggestions from code review
skirpichev Oct 8, 2024
ee22926
Apply suggestions from code review
skirpichev Oct 13, 2024
220c551
Apply suggestions from code review
skirpichev Oct 14, 2024
f068384
Apply suggestions from code review
skirpichev Oct 14, 2024
8cdd514
Merge branch 'main' into complex-float-arith-69639
skirpichev Oct 30, 2024
7fb1be1
+ move news
skirpichev Oct 30, 2024
badf492
address review:
skirpichev Oct 31, 2024
3ef5287
Merge branch 'master' into complex-float-arith-69639
skirpichev Oct 31, 2024
38762b3
address review: rename symbols in commentary to avoid clash with macro
skirpichev Oct 31, 2024
e685bd9
Update Objects/complexobject.c
skirpichev Oct 31, 2024
76bad15
Merge branch 'main' into complex-float-arith-69639
skirpichev Nov 19, 2024
de5f353
Merge branch 'master' into complex-float-arith-69639
skirpichev Nov 26, 2024
2b46a96
added sum() test
skirpichev Nov 26, 2024
759a6d0
Update Lib/test/test_builtin.py
serhiy-storchaka Nov 26, 2024
ed67dc2
I'LL NEVER USE WEB-EDITOR... I'LL NEVER USE WEB-EDITOR... I'LL NEVER …
skirpichev Nov 26, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
address review: rename symbols in commentary to avoid clash with macro
  • Loading branch information
skirpichev committed Oct 31, 2024
commit 38762b3ffbc4e5e5248c184cdcf74b7a454b399c
4 changes: 2 additions & 2 deletions Objects/complexobject.c
Original file line number Diff line number Diff line change
Expand Up @@ -614,8 +614,8 @@ real_to_complex(PyObject **pobj, Py_complex *pc)
converted to floats. We have the following rules (up to variants with changed
order of operands):

complex(x, y) + complex(u, v) = complex(x + u, y + v)
float(x) + complex(u, v) = complex(x + u, v)
complex(a, b) + complex(c, d) = complex(a + c, b + d)
float(a) + complex(b, c) = complex(a + b, c)

Similar rules are implemented for subtraction, multiplication and division.
See C11's Annex G, sections G.5.1 and G.5.2.
Comment thread
skirpichev marked this conversation as resolved.
Expand Down