Share via


creal, crealf, creall

 

The new home for Visual Studio documentation is Visual Studio 2017 Documentation on docs.microsoft.com.

The latest version of this topic can be found at creal, crealf, creall.

Retrieves the real part of a complex number.

Syntax

double creal(   
   _Dcomplex z   
);  
float creal(   
   _Fcomplex z   
);  // C++ only  
long double creal(   
   _Lcomplex z   
);  // C++ only  
float crealf(   
   _Fcomplex z   
);  
long double creall(   
  _Lcomplex z   
);  

Parameters

z
A complex number.

Return Value

The real part of z.

Remarks

Because C++ allows overloading, you can call overloads of creal that take _Fcomplex or _Lcomplex values, and return float or long double values. In a C program, creal always takes a _Dcomplex value and returns a double value.

Requirements

Routine C header C++ header
creal, crealf, creall <complex.h> <ccomplex>

For more compatibility information, see Compatibility in the Introduction.

See Also

Alphabetical Function Reference
norm, normf, norml
cproj, cprojf, cprojl
conj, conjf, conjl
cimag, cimagf, cimagl
carg, cargf, cargl
cabs, cabsf, cabsl