Skip to content

Latest commit

 

History

History
61 lines (45 loc) · 2.24 KB

cimag-cimagf-cimagl.md

File metadata and controls

61 lines (45 loc) · 2.24 KB
title description ms.date api_name api_location api_type topic_type f1_keywords helpviewer_keywords ms.assetid
cimag, cimagf, cimagl
API reference for cimag, cimagf, and cimagl; which retrieve the imaginary part of a complex number.
9/2/2020
cimag
cimagf
cimagl
msvcrt.dll
msvcr80.dll
msvcr90.dll
msvcr100.dll
msvcr100_clr0400.dll
msvcr110.dll
msvcr110_clr0400.dll
msvcr120.dll
msvcr120_clr0400.dll
ucrtbase.dll
api-ms-win-crt-math-l1-1-0.dll
DLLExport
apiref
cimagf
cimagl
complex/cimag
complex/cimagf
complex/cimagl
cimag
cimag function
cimagf function
cimagl function
0d8836f5-d61d-44cd-8731-6f75cb776def

cimag, cimagf, cimagl

Retrieves the imaginary part of a complex number.

Syntax

double cimag( _Dcomplex z );
float cimagf( _Fcomplex z );
long double cimagl( _Lcomplex z );
#define cimag(X) // Requires C11 or higher

float cimag( _Fcomplex z );  // C++ only
long double cimag( _Lcomplex z );  // C++ only

Parameters

z
A complex number.

Return value

The imaginary part of z.

Remarks

Because C++ allows overloading, you can call overloads of cimag that take _Fcomplex or _Lcomplex values, and return float or long double values. In a C program, unless you're using the <tgmath.h> macro to call this function, cimag always takes a _Dcomplex value and returns a double value.

If you use the <tgmath.h> cimag() macro, the type of the argument determines which version of the function is selected. See Type-generic math for details.

Requirements

Routine C header C++ header
cimag, cimagf, cimagl <complex.h> <ccomplex>
cimag macro <tgmath.h>

For more compatibility information, see Compatibility.

See also

Alphabetical function reference
norm, normf, norml
creal, crealf, creall
cproj, cprojf, cprojl
conj, conjf, conjl
carg, cargf, cargl
cabs, cabsf, cabsl