Skip to content

Conversation

@skirpichev
Copy link
Owner

@skirpichev skirpichev commented Sep 19, 2024

"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. 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).


📚 Documentation preview 📚: https://cpython-previews--4.org.readthedocs.build/

"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.  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).
@skirpichev skirpichev force-pushed the complex-float-arith-69639 branch from a81eed8 to 850e115 Compare September 20, 2024 08:27
@skirpichev skirpichev closed this Sep 27, 2024
@skirpichev skirpichev deleted the complex-float-arith-69639 branch September 27, 2024 03:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants