Skip to content

Latest commit

 

History

History
69 lines (54 loc) · 2.32 KB

File metadata and controls

69 lines (54 loc) · 2.32 KB
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
carg
cargf
cargl
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
DLLExport
topic_type
apiref
f1_keywords
carg
cargf
cargl
complex/carg
complex/cargf
complex/cargl
helpviewer_keywords
carg function
cargf function
cargl function

carg, cargf, cargl

Retrieves the argument of a complex number, with a branch cut along the negative real axis.

Syntax

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

Parameters

z
A complex number.

Return value

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.

Requirements

Routine C header C++ header
carg, cargf, cargl <complex.h> <ccomplex>
carg 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
cimag, cimagf, cimagl
cabs, cabsf, cabsl