Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <complex.h>
- #undef complex /* after including complex.h, before declaring struct complex */
- //#include <header_that_defines_struct_complex.h>
- struct complex
- {
- double a;
- double b;
- };
- int main(void)
- {
- // this should all be fine now
- double _Complex z = CMPLX(0.0, -0.0);
- double _Complex z1 = 1.0 + 3.0 * _Complex_I;
- double _Complex z2 = 1.0 - 4.0 * _Complex_I;
- double _Complex z3 = 1.0 + 1.0 * _Imaginary_I;
- double _Complex z4 = 1.0 + 1.0 * _Complex_I;
- double _Complex z5 = 1.0 + 1.0 * I;
- printf("Starting values: Z1 = %.2f + %.2fin", creal(z1), cimag(z1));
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement