|
|
C99 includes the keyword _Imaginary, which supports complex arithmetic. However, no implementation is required to implement imaginary types and freestanding implementations (those without operating systems) do not have to support complex types. The following _Imaginary types are defined:
float _Imaginary double _Imaginary long double _Imaginary
The reason that _Imaginary, rather than imaginary, was specified as a keyword is that many existing C programs had already defined their own custom imaginary data types using the name imaginary. By using the keyword _Imaginary, C99 avoids breaking this preexisting code.
The header <complex.h> defines (among other things) the macro imaginary, which expands to _Imaginary. Thus, for new C programs, it is best to include <complex.h> and then use the imaginary macro.
|
|