Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gh-69639: add mixed-mode rules for complex arithmetic (float case) #4

Closed
wants to merge 2 commits into from

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.

1 participant