Skip to content

Conversation

BenBrock
Copy link
Contributor

Previously, I used the complex number literal compiler extension to build complex numbers as well as extract their real and imaginary parts. (e.g. double _Complex = 2 + 1j to build the number 2 + i.)

This was nice because it avoided using <complex.h> as well as C++'s <complex>. However, not all compilers support these extensions by default. (You need to use -std=gnu++20 instead of -std=c++20.)

This PR modifies the repo to no longer use these literals, instead relying on the C specification's guaranteed memory layout for complex numbers.

@BenBrock BenBrock merged commit 6c87e03 into main Mar 19, 2025
3 checks passed
@BenBrock BenBrock deleted the dev/brock/fix-complex branch March 19, 2025 20:19
@BenBrock BenBrock mentioned this pull request Mar 19, 2025
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