| Types and the imaginary constant | ||||||||||||||||
| ||||||||||||||||
| Manipulation | ||||||||||||||||
| Power and exponential functions | ||||||||||||||||
| Trigonometric functions | ||||||||||||||||
| Hyperbolic functions | ||||||||||||||||
Defined in header <complex.h> | ||
#define _Imaginary_I /* unspecified */ | (since C99) | |
The_Imaginary_I macro expands to a value of typeconstfloat _Imaginary with the value of the imaginary unit.
As with any pure imaginary number support in C, this macro is only defined if the imaginary numbers are supported.
A compiler that defines__STDC_IEC_559_COMPLEX__ is not required to support imaginary numbers. POSIX recommends checking if the macro | (since C99) (until C11) |
Imaginary numbers are supported if__STDC_IEC_559_COMPLEX__ is defined. | (since C11) |
Contents |
This macro allows for the precise way to assemble a complex number from its real and imaginary components, e.g. with(doublecomplex)((double)x+ _Imaginary_I*(double)y). This pattern was standardized in C11 as the macroCMPLX. Note that if_Complex_I is used instead, this expression is allowed to convert negative zero to positive zero in the imaginary position.
Output:
z1 = 0.0+Infi z2 = NaN+Infi
(C99) | the complex unit constant i (macro constant)[edit] |
(C99) | the complex or imaginary unit constant i (macro constant)[edit] |