SPRUI04G June 2015 – August 2025
To store complex data using the C99 syntax, use syntax like the following:
float _Complex var1; /* always allowed */
float complex var1; /* allowed only if you include complex.h */
If you include the <complex.h> header file, complex support is available for all C/C++ modes, including relaxed and strict ANSI modes and C89 and C99. The <complex.h> header file implements math operations and functions for complex data types.
Complex types are implemented as an array of two elements. For example, for the following declaration, the variable is stored as an array of two floats. The real portion of the number is stored in x._Vals[0] and the imaginary portion of the number is stored in x._Vals[1].
float complex x;