4.75 Complex numbers in C99

In C99 mode, the compiler supports complex and imaginary numbers. In GNU mode, the compiler supports complex numbers only.

For example:
#include <stdio.h>
#include <complex.h>
int main(void)
    complex float z = 64.0 + 64.0*I;
    printf("z = %f + %fI\n", creal(z), cimag(z));
    return 0;
The complex types are:
  • float complex.
  • double complex.
  • long double complex.
Related concepts
4.59 New language features of C99
4.61 // comments in C99 and C90
4.62 Compound literals in C99
4.63 Designated initializers in C99
4.64 Hexadecimal floating-point numbers in C99
4.65 Flexible array members in C99
4.66 __func__ predefined identifier in C99
4.67 inline functions in C99
4.68 long long data type in C99 and C90
4.69 Macros with a variable number of arguments in C99
4.70 Mixed declarations and statements in C99
4.71 New block scopes for selection and iteration statements in C99
4.72 _Pragma preprocessing operator in C99
4.73 Restricted pointers in C99
4.60 New library features of C99
4.74 Additional <math.h> library functions in C99
4.76 Boolean type and <stdbool.h> in C99
4.77 Extended integer types and functions in <inttypes.h> and <stdint.h> in C99
4.78 <fenv.h> floating-point environment access in C99
4.79 <stdio.h> snprintf family of functions in C99
4.80 <tgmath.h> type-generic math macros in C99
4.81 <wchar.h> wide character I/O functions in C99
Non-ConfidentialPDF file icon PDF versionARM DUI0375F
Copyright © 2007, 2008, 2011, 2012, 2014 ARM. All rights reserved.