Advertisement
Guest User

Untitled

a guest
Jun 20th, 2019
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.66 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <complex.h>
  3. #undef complex /* after including complex.h, before declaring struct complex */
  4.  
  5. //#include <header_that_defines_struct_complex.h>
  6. struct complex
  7. {
  8. double a;
  9. double b;
  10. };
  11.  
  12. int main(void)
  13. {
  14. // this should all be fine now
  15. double _Complex z = CMPLX(0.0, -0.0);
  16. double _Complex z1 = 1.0 + 3.0 * _Complex_I;
  17. double _Complex z2 = 1.0 - 4.0 * _Complex_I;
  18. double _Complex z3 = 1.0 + 1.0 * _Imaginary_I;
  19. double _Complex z4 = 1.0 + 1.0 * _Complex_I;
  20. double _Complex z5 = 1.0 + 1.0 * I;
  21. printf("Starting values: Z1 = %.2f + %.2fin", creal(z1), cimag(z1));
  22.  
  23. return 0;
  24. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement