xref: /freebsd/lib/msun/man/complex.3 (revision 658a47d1ef6a0e8d56d346c5c16dcb2e001c3a40)
1.\" Copyright (c) 2011 Murray Stokely <murray@FreeBSD.org>
2.\" All rights reserved.
3.\"
4.\" Redistribution and use in source and binary forms, with or without
5.\" modification, are permitted provided that the following conditions
6.\" are met:
7.\" 1. Redistributions of source code must retain the above copyright
8.\"    notice, this list of conditions and the following disclaimer.
9.\" 2. Redistributions in binary form must reproduce the above copyright
10.\"    notice, this list of conditions and the following disclaimer in the
11.\"    documentation and/or other materials provided with the distribution.
12.\"
13.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND
14.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
15.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
16.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR BE LIABLE
17.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
18.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
19.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
20.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
21.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
22.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
23.\" SUCH DAMAGE.
24.\"
25.\" $FreeBSD$
26.\"
27.Dd November 3, 2021
28.Dt COMPLEX 3
29.Os
30.Sh NAME
31.Nm complex
32.Nd "complex arithmetic"
33.Sh LIBRARY
34.Lb libm
35.Sh SYNOPSIS
36.In complex.h
37.Sh DESCRIPTION
38These functions support complex arithmetic in the C math library.
39.Sh "LIST OF FUNCTIONS"
40Each of the following
41.Vt "double complex"
42functions has a
43.Vt "float complex"
44counterpart with an
45.Ql f
46appended to the name and a
47.Vt "long double complex"
48counterpart with an
49.Ql l
50appended.
51As an example, the
52.Vt "float complex"
53and
54.Vt "long double complex"
55counterparts of
56.Ft double
57.Fn cabs "double complex z"
58are
59.Ft float
60.Fn cabsf "float complex z"
61and
62.Ft "long double"
63.Fn cabsl "long double complex z" ,
64respectively.
65.de Cl
66.Bl -column "csqrt" "complex absolute value (i.e., norm, modulus, magnitude)"
67.Em "Name	Description"
68..
69.\" Section 7.3.5 - 7.3.7 of ISO C99 standard unimplemented, see BUGS
70.\" Section 7.3.8 of ISO C99 standard
71.Ss Absolute-value Functions
72.Cl
73cabs	complex absolute value (i.e., norm, modulus, magnitude)
74csqrt	complex square root
75.El
76.Ss Exponential Function
77.Cl
78cexp	exponential base e
79.El
80.Ss Natural logarithm Function
81.Cl
82clog	natural logarithm
83.El
84.\" Section 7.3.9 of ISO C99 standard
85.Ss Manipulation Functions
86.Cl
87carg	compute the argument (i.e., phase angle)
88cimag	compute the imaginary part
89conj	compute the complex conjugate
90cproj	compute projection onto Riemann sphere
91creal	compute the real part
92.El
93.\" Section 7.3.5-6 of ISO C99 standard
94.Ss Trigonometric and Hyperbolic Functions
95.Cl
96cacos	arc cosine
97cacosh	arc hyperbolic cosine
98casin	arc sine
99casinh	arc hyperbolic sine
100catan	arc tangent
101catanh	arc hyperbolic tangent
102ccos	cosine
103ccosh	hyperbolic cosine
104cpow	power function
105csin	sine
106csinh	hyperbolic sine
107ctan	tangent
108ctanh	hyperbolic tangent
109.El
110.Sh SEE ALSO
111.Xr fenv 3 ,
112.Xr ieee 3 ,
113.Xr math 3 ,
114.Xr tgmath 3
115.Rs
116.%T "ISO/IEC 9899:TC3"
117.%U http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1256.pdf
118.Re
119.Sh STANDARDS
120The
121.In complex.h
122functions described here conform to
123.St -isoC-99 .
124.Sh BUGS
125The power functions,
126.Fn cpowf, cpow ,
127and
128.Fn cpowl ,
129are implemented, but the code was neither reviewed nor tested.
130