1<complex.h>(0P) POSIX Programmer's Manual <complex.h>(0P)
2
3
4
6 complex.h - complex arithmetic
7
9 #include <complex.h>
10
12 The <complex.h> header shall define the following macros:
13
14 complex
15 Expands to _Complex.
16
17 _Complex_I
18 Expands to a constant expression of type const float _Complex,
19 with the value of the imaginary unit (that is, a number i such
20 that i**2=-1).
21
22 imaginary
23 Expands to _Imaginary.
24
25 _Imaginary_I
26 Expands to a constant expression of type const float _Imaginary
27 with the value of the imaginary unit.
28
29 I Expands to either _Imaginary_I or _Complex_I. If _Imaginary_I is
30 not defined, I expands to _Complex_I.
31
32
33 The macros imaginary and _Imaginary_I shall be defined if and only if
34 the implementation supports imaginary types.
35
36 An application may undefine and then, perhaps, redefine the complex,
37 imaginary, and I macros.
38
39 The following shall be declared as functions and may also be defined as
40 macros. Function prototypes shall be provided.
41
42
43 double cabs(double complex);
44 float cabsf(float complex);
45 long double cabsl(long double complex);
46 double complex cacos(double complex);
47 float complex cacosf(float complex);
48 double complex cacosh(double complex);
49 float complex cacoshf(float complex);
50 long double complex cacoshl(long double complex);
51 long double complex cacosl(long double complex);
52 double carg(double complex);
53 float cargf(float complex);
54 long double cargl(long double complex);
55 double complex casin(double complex);
56 float complex casinf(float complex);
57 double complex casinh(double complex);
58 float complex casinhf(float complex);
59 long double complex casinhl(long double complex);
60 long double complex casinl(long double complex);
61 double complex catan(double complex);
62 float complex catanf(float complex);
63 double complex catanh(double complex);
64 float complex catanhf(float complex);
65 long double complex catanhl(long double complex);
66 long double complex catanl(long double complex);
67 double complex ccos(double complex);
68 float complex ccosf(float complex);
69 double complex ccosh(double complex);
70 float complex ccoshf(float complex);
71 long double complex ccoshl(long double complex);
72 long double complex ccosl(long double complex);
73 double complex cexp(double complex);
74 float complex cexpf(float complex);
75 long double complex cexpl(long double complex);
76 double cimag(double complex);
77 float cimagf(float complex);
78 long double cimagl(long double complex);
79 double complex clog(double complex);
80 float complex clogf(float complex);
81 long double complex clogl(long double complex);
82 double complex conj(double complex);
83 float complex conjf(float complex);
84 long double complex conjl(long double complex);
85 double complex cpow(double complex, double complex);
86 float complex cpowf(float complex, float complex);
87 long double complex cpowl(long double complex, long double complex);
88 double complex cproj(double complex);
89 float complex cprojf(float complex);
90 long double complex cprojl(long double complex);
91 double creal(double complex);
92 float crealf(float complex);
93 long double creall(long double complex);
94 double complex csin(double complex);
95 float complex csinf(float complex);
96 double complex csinh(double complex);
97 float complex csinhf(float complex);
98 long double complex csinhl(long double complex);
99 long double complex csinl(long double complex);
100 double complex csqrt(double complex);
101 float complex csqrtf(float complex);
102 long double complex csqrtl(long double complex);
103 double complex ctan(double complex);
104 float complex ctanf(float complex);
105 double complex ctanh(double complex);
106 float complex ctanhf(float complex);
107 long double complex ctanhl(long double complex);
108 long double complex ctanl(long double complex);
109
110 The following sections are informative.
111
113 Values are interpreted as radians, not degrees.
114
116 The choice of I instead of i for the imaginary unit concedes to the
117 widespread use of the identifier i for other purposes. The application
118 can use a different identifier, say j, for the imaginary unit by fol‐
119 lowing the inclusion of the <complex.h> header with:
120
121
122 #undef I
123 #define j _Imaginary_I
124
125 An I suffix to designate imaginary constants is not required, as multi‐
126 plication by I provides a sufficiently convenient and more generally
127 useful notation for imaginary terms. The corresponding real type for
128 the imaginary unit is float, so that use of I for algorithmic or nota‐
129 tional convenience will not result in widening types.
130
131 On systems with imaginary types, the application has the ability to
132 control whether use of the macro I introduces an imaginary type, by
133 explicitly defining I to be _Imaginary_I or _Complex_I. Disallowing
134 imaginary types is useful for some applications intended to run on
135 implementations without support for such types.
136
137 The macro _Imaginary_I provides a test for whether imaginary types are
138 supported.
139
140 The cis() function (cos(x) + I*sin(x)) was considered but rejected
141 because its implementation is easy and straightforward, even though
142 some implementations could compute sine and cosine more efficiently in
143 tandem.
144
146 The following function names and the same names suffixed with f or l
147 are reserved for future use, and may be added to the declarations in
148 the <complex.h> header.
149
150 cerf() cexpm1() clog2()
151 cerfc() clog10() clgamma()
152 cexp2() clog1p() ctgamma()
153
154
156 The System Interfaces volume of IEEE Std 1003.1-2001, cabs(), cacos(),
157 cacosh(), carg(), casin(), casinh(), catan(), catanh(), ccos(),
158 ccosh(), cexp(), cimag(), clog(), conj(), cpow(), cproj(), creal(),
159 csin(), csinh(), csqrt(), ctan(), ctanh()
160
162 Portions of this text are reprinted and reproduced in electronic form
163 from IEEE Std 1003.1, 2003 Edition, Standard for Information Technology
164 -- Portable Operating System Interface (POSIX), The Open Group Base
165 Specifications Issue 6, Copyright (C) 2001-2003 by the Institute of
166 Electrical and Electronics Engineers, Inc and The Open Group. In the
167 event of any discrepancy between this version and the original IEEE and
168 The Open Group Standard, the original IEEE and The Open Group Standard
169 is the referee document. The original Standard can be obtained online
170 at http://www.opengroup.org/unix/online.html .
171
172
173
174IEEE/The Open Group 2003 <complex.h>(0P)