Skip to content

Commit

Permalink
pythongh-69639: Add mixed-mode rules for complex arithmetic (C-like) (p…
Browse files Browse the repository at this point in the history
…ythonGH-124829)

"Generally, mixed-mode arithmetic combining real and complex variables should
be performed directly, not by first coercing the real to complex, lest the sign
of zero be rendered uninformative; the same goes for combinations of pure
imaginary quantities with complex variables." (c) Kahan, W: Branch cuts for
complex elementary functions.

This patch implements mixed-mode arithmetic rules, combining real and
complex variables as specified by C standards since C99 (in particular,
there is no special version for the true division with real lhs
operand).  Most C compilers implementing C99+ Annex G have only these
special rules (without support for imaginary type, which is going to be
deprecated in C2y).
  • Loading branch information
skirpichev authored and ebonnal committed Jan 10, 2025
1 parent 4948459 commit 6079b6e
Showing 0 changed files with 0 additions and 0 deletions.

0 comments on commit 6079b6e

Please sign in to comment.