1 .\" Copyright 2002 Walter Harms (walter.harms@informatik.uni-oldenburg.de)
3 .\" SPDX-License-Identifier: GPL-1.0-or-later
5 .TH CARG 3 2021-03-22 "" "Linux Programmer's Manual"
7 carg, cargf, cargl \- calculate the complex argument
10 .RI ( libm ", " \-lm )
13 .B #include <complex.h>
15 .BI "double carg(double complex " z ");"
16 .BI "float cargf(float complex " z ");"
17 .BI "long double cargl(long double complex " z ");"
20 These functions calculate the complex argument (also called phase angle) of
22 with a branch cut along the negative real axis.
24 A complex number can be described by two real coordinates.
25 One may use rectangular coordinates and gets
34 .IR "y\ =\ cimag(z)" .
36 Or one may use polar coordinates and gets
44 is the "radius", the "modulus", the absolute value of
48 is the "phase angle", the argument of
54 tan(carg(z)) = cimag(z) / creal(z)
57 The return value is in the range of [\-pi,pi].
59 These functions first appeared in glibc in version 2.1.
61 For an explanation of the terms used in this section, see
69 Interface Attribute Value
74 T} Thread safety MT-Safe
80 C99, POSIX.1-2001, POSIX.1-2008.