1complex.h(0P)              POSIX Programmer's Manual             complex.h(0P)
2
3
4

PROLOG

6       This  manual  page is part of the POSIX Programmer's Manual.  The Linux
7       implementation of this interface may differ (consult the  corresponding
8       Linux  manual page for details of Linux behavior), or the interface may
9       not be implemented on Linux.
10
11

NAME

13       complex.h — complex arithmetic
14

SYNOPSIS

16       #include <complex.h>
17

DESCRIPTION

19       The functionality described on this reference page is aligned with  the
20       ISO C  standard.  Any  conflict between the requirements described here
21       and the ISO C standard is unintentional. This  volume  of  POSIX.1‐2008
22       defers to the ISO C standard.
23
24       The <complex.h> header shall define the following macros:
25
26       complex     Expands to _Complex.
27
28       _Complex_I  Expands  to a constant expression of type const float _Com‐
29                   plex, with the value of the imaginary unit (that is, a num‐
30                   ber i such that i2=−1).
31
32       imaginary   Expands to _Imaginary.
33
34       _Imaginary_I
35                   Expands to a constant expression of type const float _Imag‐
36                   inary with the value of the imaginary unit.
37
38       I           Expands to either _Imaginary_I or  _Complex_I.  If  _Imagi‐
39                   nary_I is not defined, I expands to _Complex_I.
40
41       The  macros  imaginary and _Imaginary_I shall be defined if and only if
42       the implementation supports imaginary types.
43
44       An application may undefine and then, perhaps,  redefine  the  complex,
45       imaginary, and I macros.
46
47       The following shall be declared as functions and may also be defined as
48       macros. Function prototypes shall be provided.
49
50           double               cabs(double complex);
51           float                cabsf(float complex);
52           long double          cabsl(long double complex);
53           double complex       cacos(double complex);
54           float complex        cacosf(float complex);
55           double complex       cacosh(double complex);
56           float complex        cacoshf(float complex);
57           long double complex  cacoshl(long double complex);
58           long double complex  cacosl(long double complex);
59           double               carg(double complex);
60           float                cargf(float complex);
61           long double          cargl(long double complex);
62           double complex       casin(double complex);
63           float complex        casinf(float complex);
64           double complex       casinh(double complex);
65           float complex        casinhf(float complex);
66           long double complex  casinhl(long double complex);
67           long double complex  casinl(long double complex);
68           double complex       catan(double complex);
69           float complex        catanf(float complex);
70           double complex       catanh(double complex);
71           float complex        catanhf(float complex);
72           long double complex  catanhl(long double complex);
73           long double complex  catanl(long double complex);
74           double complex       ccos(double complex);
75           float complex        ccosf(float complex);
76           double complex       ccosh(double complex);
77           float complex        ccoshf(float complex);
78           long double complex  ccoshl(long double complex);
79           long double complex  ccosl(long double complex);
80           double complex       cexp(double complex);
81           float complex        cexpf(float complex);
82           long double complex  cexpl(long double complex);
83           double               cimag(double complex);
84           float                cimagf(float complex);
85           long double          cimagl(long double complex);
86           double complex       clog(double complex);
87           float complex        clogf(float complex);
88           long double complex  clogl(long double complex);
89           double complex       conj(double complex);
90           float complex        conjf(float complex);
91           long double complex  conjl(long double complex);
92           double complex       cpow(double complex, double complex);
93           float complex        cpowf(float complex, float complex);
94           long double complex  cpowl(long double complex, long double complex);
95           double complex       cproj(double complex);
96           float complex        cprojf(float complex);
97           long double complex  cprojl(long double complex);
98           double               creal(double complex);
99           float                crealf(float complex);
100           long double          creall(long double complex);
101           double complex       csin(double complex);
102           float complex        csinf(float complex);
103           double complex       csinh(double complex);
104           float complex        csinhf(float complex);
105           long double complex  csinhl(long double complex);
106           long double complex  csinl(long double complex);
107           double complex       csqrt(double complex);
108           float complex        csqrtf(float complex);
109           long double complex  csqrtl(long double complex);
110           double complex       ctan(double complex);
111           float complex        ctanf(float complex);
112           double complex       ctanh(double complex);
113           float complex        ctanhf(float complex);
114           long double complex  ctanhl(long double complex);
115           long double complex  ctanl(long double complex);
116
117       The following sections are informative.
118

APPLICATION USAGE

120       Values are interpreted as radians, not degrees.
121

RATIONALE

123       The choice of I instead of i for the imaginary  unit  concedes  to  the
124       widespread  use of the identifier i for other purposes. The application
125       can use a different identifier, say j, for the imaginary unit  by  fol‐
126       lowing the inclusion of the <complex.h> header with:
127
128           #undef I
129           #define j _Imaginary_I
130
131       An I suffix to designate imaginary constants is not required, as multi‐
132       plication by I provides a sufficiently convenient  and  more  generally
133       useful  notation  for  imaginary terms. The corresponding real type for
134       the imaginary unit is float, so that use of I for algorithmic or  nota‐
135       tional convenience will not result in widening types.
136
137       On  systems  with  imaginary  types, the application has the ability to
138       control whether use of the macro I introduces  an  imaginary  type,  by
139       explicitly  defining  I  to  be _Imaginary_I or _Complex_I. Disallowing
140       imaginary types is useful for some  applications  intended  to  run  on
141       implementations without support for such types.
142
143       The  macro _Imaginary_I provides a test for whether imaginary types are
144       supported.
145
146       The cis() function (cos(x) +  I*sin(x))  was  considered  but  rejected
147       because  its  implementation  is  easy and straightforward, even though
148       some implementations could compute sine and cosine more efficiently  in
149       tandem.
150

FUTURE DIRECTIONS

152       The  following  function  names and the same names suffixed with f or l
153       are reserved for future use, and may be added to  the  declarations  in
154       the <complex.h> header.
155
156
157              cerf()    cexpm1()   clog2()
158              cerfc()   clog10()   clgamma()
159              cexp2()   clog1p()   ctgamma()
160

SEE ALSO

162       The   System   Interfaces  volume  of  POSIX.1‐2008,  cabs(),  cacos(),
163       cacosh(),  carg(),  casin(),  casinh(),  catan(),   catanh(),   ccos(),
164       ccosh(),  cexp(),  cimag(),  clog(),  conj(), cpow(), cproj(), creal(),
165       csin(), csinh(), csqrt(), ctan(), ctanh()
166
168       Portions of this text are reprinted and reproduced in  electronic  form
169       from IEEE Std 1003.1, 2013 Edition, Standard for Information Technology
170       -- Portable Operating System Interface (POSIX),  The  Open  Group  Base
171       Specifications Issue 7, Copyright (C) 2013 by the Institute of Electri‐
172       cal and Electronics Engineers,  Inc  and  The  Open  Group.   (This  is
173       POSIX.1-2008  with  the  2013  Technical Corrigendum 1 applied.) In the
174       event of any discrepancy between this version and the original IEEE and
175       The  Open Group Standard, the original IEEE and The Open Group Standard
176       is the referee document. The original Standard can be  obtained  online
177       at http://www.unix.org/online.html .
178
179       Any  typographical  or  formatting  errors that appear in this page are
180       most likely to have been introduced during the conversion of the source
181       files  to  man page format. To report such errors, see https://www.ker
182       nel.org/doc/man-pages/reporting_bugs.html .
183
184
185
186IEEE/The Open Group                  2013                        complex.h(0P)
Impressum