gcc: Complex

1 
1 6.10 Complex Numbers
1 ====================
1 
1 ISO C99 supports complex floating data types, and as an extension GCC
1 supports them in C90 mode and in C++.  GCC also supports complex integer
1 data types which are not part of ISO C99.  You can declare complex types
1 using the keyword '_Complex'.  As an extension, the older GNU keyword
1 '__complex__' is also supported.
1 
1  For example, '_Complex double x;' declares 'x' as a variable whose real
1 part and imaginary part are both of type 'double'.  '_Complex short int
1 y;' declares 'y' to have real and imaginary parts of type 'short int';
1 this is not likely to be useful, but it shows that the set of complex
1 types is complete.
1 
1  To write a constant with a complex data type, use the suffix 'i' or 'j'
1 (either one; they are equivalent).  For example, '2.5fi' has type
1 '_Complex float' and '3i' has type '_Complex int'.  Such a constant
1 always has a pure imaginary value, but you can form any complex value
1 you like by adding one to a real constant.  This is a GNU extension; if
1 you have an ISO C99 conforming C library (such as the GNU C Library),
1 and want to construct complex constants of floating type, you should
1 include '<complex.h>' and use the macros 'I' or '_Complex_I' instead.
1 
1  The ISO C++14 library also defines the 'i' suffix, so C++14 code that
1 includes the '<complex>' header cannot use 'i' for the GNU extension.
1 The 'j' suffix still has the GNU meaning.
1 
1  To extract the real part of a complex-valued expression EXP, write
1 '__real__ EXP'.  Likewise, use '__imag__' to extract the imaginary part.
1 This is a GNU extension; for values of floating type, you should use the
1 ISO C99 functions 'crealf', 'creal', 'creall', 'cimagf', 'cimag' and
1 'cimagl', declared in '<complex.h>' and also provided as built-in
1 functions by GCC.
1 
1  The operator '~' performs complex conjugation when used on a value with
1 a complex type.  This is a GNU extension; for values of floating type,
1 you should use the ISO C99 functions 'conjf', 'conj' and 'conjl',
1 declared in '<complex.h>' and also provided as built-in functions by
1 GCC.
1 
1  GCC can allocate complex automatic variables in a noncontiguous
1 fashion; it's even possible for the real part to be in a register while
1 the imaginary part is on the stack (or vice versa).  Only the DWARF
1 debug info format can represent this, so use of DWARF is recommended.
1 If you are using the stabs debug info format, GCC describes a
1 noncontiguous complex variable as if it were two separate variables of
1 noncomplex type.  If the variable's actual name is 'foo', the two
1 fictitious variables are named 'foo$real' and 'foo$imag'.  You can
1 examine and set these two fictitious variables with your debugger.
1