1 .\" Copyright 2002 Walter Harms (walter.harms@informatik.uni-oldenburg.de)
3 .\" SPDX-License-Identifier: GPL-1.0-or-later
5 .TH carg 3 (date) "Linux man-pages (unreleased)"
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
38 Or one may use polar coordinates and gets
48 is the "radius", the "modulus", the absolute value of
52 is the "phase angle", the argument of
59 tan(carg(z)) = cimag(z) / creal(z)
63 The return value is in the range of [\-pi,pi].
65 These functions first appeared in glibc in version 2.1.
67 For an explanation of the terms used in this section, see
75 Interface Attribute Value
80 T} Thread safety MT-Safe
86 C99, POSIX.1-2001, POSIX.1-2008.