#define cimag( z )
(4) (since C99)1-3) Returns the imaginary part of z
.
Type-generic macro: if
z
has type
long double complex,
long double imaginary, or
long double,
cimagl
is called. If
z
has type
float complex,
float imaginary, or
float,
cimagf
is called. If
z
has type
double complex,
double imaginary,
double, or any integer type,
cimag
is called.
[edit] Parameters [edit] Return valueThe imaginary part of z
.
This function is fully specified for all possible inputs and is not subject to any errors described in math_errhandling
[edit] NotesFor any complex variable z
, z == creal(z) + I*cimag(z).
#include <stdio.h> #include <complex.h> int main(void) { double complex z = 1.0 + 2.0*I; printf("%f%+fi\n", creal(z), cimag(z)); }
Output:
[edit] ReferencesRetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4