crealf, creal, creall

Header: <complex.h>

1-3) Returns the real part of z.

# Declarations

float crealf( float complex z );

(since C99)

double creal( double complex z );

(since C99)

long double creall( long double complex z );

(since C99)

#define creal( z )

(since C99)

# Parameters

# Return value

The real part of z.

# Notes

For any complex variable z, z == creal(z) + I*cimag(z).

# Example

#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));
}

# See also