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.

C(s)C++ Programmer's Reference
C Programming on the IBM PC (C Programmers Reference Guide Series)
ISBN: 0673462897
EAN: 2147483647
Year: 2002
Pages: 539 © 2008-2017.
If you may any questions please contact us: