]> git.ipfire.org Git - thirdparty/man-pages.git/blob - man3/carg.3
carg.3: ATTRIBUTES: Note functions that are thread-safe
[thirdparty/man-pages.git] / man3 / carg.3
1 .\" Copyright 2002 Walter Harms (walter.harms@informatik.uni-oldenburg.de)
2 .\"
3 .\" %%%LICENSE_START(GPL_NOVERSION_ONELINE)
4 .\" Distributed under GPL
5 .\" %%%LICENSE_END
6 .\"
7 .TH CARG 3 2008-08-11 "" "Linux Programmer's Manual"
8 .SH NAME
9 carg, cargf, cargl \- calculate the complex argument
10 .SH SYNOPSIS
11 .B #include <complex.h>
12 .sp
13 .BI "double carg(double complex " z ");"
14 .br
15 .BI "float cargf(float complex " z ");"
16 .br
17 .BI "long double cargl(long double complex " z ");"
18 .sp
19 Link with \fI\-lm\fP.
20 .SH DESCRIPTION
21 A complex number can be described by two real coordinates.
22 One may use rectangular coordinates and gets
23
24 .nf
25 z = x + I * y
26 .fi
27
28 where
29 .IR "x\ =\ creal(z)"
30 and
31 .IR "y\ =\ cimag(z)" .
32 .LP
33 Or one may use polar coordinates and gets
34 .nf
35
36 z = r * cexp(I * a)
37
38 .fi
39 where
40 .IR "r\ =\ cabs(z)"
41 is the "radius", the "modulus", the absolute value of
42 .IR z ,
43 and
44 .IR "a\ =\ carg(z)"
45 is the "phase angle", the argument of
46 .IR z .
47 .LP
48 One has:
49 .nf
50
51 tan(carg(z)) = cimag(z) / creal(z)
52 .fi
53 .SH RETURN VALUE
54 The return value is the range of [\-pi,pi].
55 .SH VERSIONS
56 These functions first appeared in glibc in version 2.1.
57 .SH ATTRIBUTES
58 For an explanation of the terms used in this section, see
59 .BR attributes (7).
60 .TS
61 allbox;
62 lbw24 lb lb
63 l l l.
64 Interface Attribute Value
65 T{
66 .BR carg (),
67 .BR cargf (),
68 .BR cargl ()
69 T} Thread safety MT-Safe
70 .TE
71 .SH CONFORMING TO
72 C99.
73 .SH SEE ALSO
74 .BR cabs (3),
75 .BR complex (7)