z
.z
has type long double complex
, long double imaginary
, or long double
, creall
is called. If z
has type float complex
, float imaginary
, or float
, crealf
is called. If z
has type double complex
, double imaginary
, double
, or any integer type, creal
is called.z | - | complex argument |
The real part of z
.
This function is fully specified for all possible inputs and is not subject to any errors described in math_errhandling.
For 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:
(C99)(C99)(C99) | computes the imaginary part a complex number (function) |
C++ documentation for real |
© cppreference.com
Licensed under the Creative Commons Attribution-ShareAlike Unported License v3.0.
https://en.cppreference.com/w/c/numeric/complex/creal