# cargf, carg, cargl

< c‎ | numeric‎ | complex

C
 Language headers Type support Dynamic memory management Error handling Program utilities Variadic function support Date and time utilities Strings library Algorithms Numerics Input/output support Localization support Thread support (C11) Atomic operations (C11) Technical Specifications

Complex number arithmetic
Types and the imaginary constant
Manipulation
 cimag creal carg
Power and exponential functions
Trigonometric functions
Hyperbolic functions

 Defined in header `` float       cargf( float complex z ); (since C99) double      carg( double complex z ); (since C99) long double cargl( long double complex z ); (since C99)

Computes the argument (also called phase angle) of `z`, with a branch cut along the negative real axis.

### Parameters

 z - complex argument

### Return value

The argument of `z` in the interval (−π; π).

### Example

```#include <stdio.h>
#include <complex.h>
#include <math.h>

int main()
{
double complex z;                 /* complex number     */
double phase;                     /* phase angle        */
double rtod = 180.0/acos(-1.0);   /* radians to degrees */

z = 0.0+0.0*_Complex_I;
phase = carg(z);

z = 1.0+1.0*_Complex_I;
phase = carg(z);

z = -1.0+1.0*_Complex_I;
phase = carg(z);

z = -1.0-1.0*_Complex_I;
phase = carg(z);

z = 1.0-1.0*_Complex_I;
phase = carg(z);
```0.000000 radians,     0.0 degrees