| Types and the imaginary constant | |||||||||||||||||||||||||||||||
|
| ||||||||||||||||||||||||||||||
| Manipulation | |||||||||||||||||||||||||||||||
| Power and exponential functions | |||||||||||||||||||||||||||||||
| Trigonometric functions | |||||||||||||||||||||||||||||||
| Hyperbolic functions | |||||||||||||||||||||||||||||||
Defined in header <complex.h> | ||
#define imaginary _Imaginary | (since C99) | |
This macro expands to the keyword_Imaginary.
This is a convenience macro that makes it possible to usefloat imaginary,double imaginary, andlongdouble imaginary as an alternative way to write the three pure imaginary C typesfloat _Imaginary,double _Imaginary, andlongdouble _Imaginary
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_Imaginary_I is defined to identify imaginary number support. | (since C99) (until C11) |
Imaginary numbers are supported if__STDC_IEC_559_COMPLEX__ is defined. | (since C11) |
Contents |
Programs are allowed to undefine and perhaps redefine theimaginary macro.
To date, only Oracle C compiler is known to have implemented imaginary types.
Output:
z = 1.0-2.0i
(C99) | complex type macro (keyword macro)[edit] |