| title |
carg, cargf, cargl |
| description |
API reference for carg, cargf, and cargl; which retrieve the argument of a complex number, with a branch cut along the negative real axis. |
| ms.date |
9/2/2020 |
| api_name |
|
| api_location |
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 |
|
| api_type |
|
| topic_type |
|
| f1_keywords |
carg |
cargf |
cargl |
complex/carg |
complex/cargf |
complex/cargl |
|
| helpviewer_keywords |
carg function |
cargf function |
cargl function |
|
Retrieves the argument of a complex number, with a branch cut along the negative real axis.
double carg(
_Dcomplex z
);
float carg(
_Fcomplex z
); // C++ only
long double carg(
_Lcomplex z
); // C++ only
float cargf(
_Fcomplex z
);
long double cargl(
_Lcomplex z
);
#define carg(X) // Requires C11 or later
z
A complex number.
The argument (also known as the phase) of z. The result is in the interval [-π, +π].
Remarks
Because C++ allows overloading, you can call overloads of carg 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, carg always takes a _Dcomplex value and returns a double value.
If you use the <tgmath.h> carg() macro, the type of the argument determines which version of the function is selected. See Type-generic math for details.
| Routine |
C header |
C++ header |
carg, cargf, cargl |
<complex.h> |
<ccomplex> |
carg macro |
<tgmath.h> |
|
For more compatibility information, see Compatibility.
Alphabetical function reference
norm, normf, norml
creal, crealf, creall
cproj, cprojf, cprojl
conj, conjf, conjl
cimag, cimagf, cimagl
cabs, cabsf, cabsl