Created
February 5, 2020 05:49
-
-
Save appleparan/4b1254e7bee5225fd233c76fc0d47304 to your computer and use it in GitHub Desktop.
Complex usage in C
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <complex.h> | |
/* | |
Compile option : icc -std=c99 main.c -o main | |
*/ | |
int main() { | |
double complex a; | |
a = 1.0 + I * 2.0; | |
printf("%f + i%f\n", creal(a), cimag(a)); // 1.000 + i2.000 | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment