xref: /freebsd/lib/msun/man/complex.3 (revision fa9896e082a1046ff4fbc75fcba4d18d1f2efc19)
111725f21SMurray Stokely.\" Copyright (c) 2011 Murray Stokely <murray@FreeBSD.org>
211725f21SMurray Stokely.\" All rights reserved.
311725f21SMurray Stokely.\"
411725f21SMurray Stokely.\" Redistribution and use in source and binary forms, with or without
511725f21SMurray Stokely.\" modification, are permitted provided that the following conditions
611725f21SMurray Stokely.\" are met:
711725f21SMurray Stokely.\" 1. Redistributions of source code must retain the above copyright
811725f21SMurray Stokely.\"    notice, this list of conditions and the following disclaimer.
911725f21SMurray Stokely.\" 2. Redistributions in binary form must reproduce the above copyright
1011725f21SMurray Stokely.\"    notice, this list of conditions and the following disclaimer in the
1111725f21SMurray Stokely.\"    documentation and/or other materials provided with the distribution.
1211725f21SMurray Stokely.\"
1311725f21SMurray Stokely.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND
1411725f21SMurray Stokely.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
1511725f21SMurray Stokely.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
1611725f21SMurray Stokely.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR BE LIABLE
1711725f21SMurray Stokely.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
1811725f21SMurray Stokely.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
1911725f21SMurray Stokely.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
2011725f21SMurray Stokely.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
2111725f21SMurray Stokely.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
2211725f21SMurray Stokely.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
2311725f21SMurray Stokely.\" SUCH DAMAGE.
2411725f21SMurray Stokely.\"
25*046e2d5dSSteve Kargl.Dd November 3, 2021
2611725f21SMurray Stokely.Dt COMPLEX 3
2711725f21SMurray Stokely.Os
2811725f21SMurray Stokely.Sh NAME
2911725f21SMurray Stokely.Nm complex
3011725f21SMurray Stokely.Nd "complex arithmetic"
3111725f21SMurray Stokely.Sh LIBRARY
3211725f21SMurray Stokely.Lb libm
3311725f21SMurray Stokely.Sh SYNOPSIS
3411725f21SMurray Stokely.In complex.h
3511725f21SMurray Stokely.Sh DESCRIPTION
3611725f21SMurray StokelyThese functions support complex arithmetic in the C math library.
3711725f21SMurray Stokely.Sh "LIST OF FUNCTIONS"
3811725f21SMurray StokelyEach of the following
3911725f21SMurray Stokely.Vt "double complex"
4011725f21SMurray Stokelyfunctions has a
4111725f21SMurray Stokely.Vt "float complex"
4211725f21SMurray Stokelycounterpart with an
4311725f21SMurray Stokely.Ql f
4411725f21SMurray Stokelyappended to the name and a
4511725f21SMurray Stokely.Vt "long double complex"
4611725f21SMurray Stokelycounterpart with an
4711725f21SMurray Stokely.Ql l
4811725f21SMurray Stokelyappended.
4911725f21SMurray StokelyAs an example, the
5011725f21SMurray Stokely.Vt "float complex"
5111725f21SMurray Stokelyand
5211725f21SMurray Stokely.Vt "long double complex"
5311725f21SMurray Stokelycounterparts of
5411725f21SMurray Stokely.Ft double
5511725f21SMurray Stokely.Fn cabs "double complex z"
5611725f21SMurray Stokelyare
5711725f21SMurray Stokely.Ft float
5811725f21SMurray Stokely.Fn cabsf "float complex z"
5911725f21SMurray Stokelyand
6011725f21SMurray Stokely.Ft "long double"
6111725f21SMurray Stokely.Fn cabsl "long double complex z" ,
6211725f21SMurray Stokelyrespectively.
6311725f21SMurray Stokely.de Cl
64bc5356c5SConrad Meyer.Bl -column "csqrt" "complex absolute value (i.e., norm, modulus, magnitude)"
6511725f21SMurray Stokely.Em "Name	Description"
6611725f21SMurray Stokely..
6711725f21SMurray Stokely.\" Section 7.3.5 - 7.3.7 of ISO C99 standard unimplemented, see BUGS
6811725f21SMurray Stokely.\" Section 7.3.8 of ISO C99 standard
6911725f21SMurray Stokely.Ss Absolute-value Functions
7011725f21SMurray Stokely.Cl
71bc5356c5SConrad Meyercabs	complex absolute value (i.e., norm, modulus, magnitude)
7211725f21SMurray Stokelycsqrt	complex square root
7311725f21SMurray Stokely.El
74d1327156SDavid Schultz.Ss Exponential Function
75d1327156SDavid Schultz.Cl
76d1327156SDavid Schultzcexp	exponential base e
77d1327156SDavid Schultz.El
78bc5356c5SConrad Meyer.Ss Natural logarithm Function
790c0288a2SKonstantin Belousov.Cl
80bc5356c5SConrad Meyerclog	natural logarithm
810c0288a2SKonstantin Belousov.El
8211725f21SMurray Stokely.\" Section 7.3.9 of ISO C99 standard
8311725f21SMurray Stokely.Ss Manipulation Functions
8411725f21SMurray Stokely.Cl
85bc5356c5SConrad Meyercarg	compute the argument (i.e., phase angle)
8611725f21SMurray Stokelycimag	compute the imaginary part
8711725f21SMurray Stokelyconj	compute the complex conjugate
8811725f21SMurray Stokelycproj	compute projection onto Riemann sphere
8911725f21SMurray Stokelycreal	compute the real part
9011725f21SMurray Stokely.El
913daee1d6SDavid Schultz.\" Section 7.3.5-6 of ISO C99 standard
923daee1d6SDavid Schultz.Ss Trigonometric and Hyperbolic Functions
933daee1d6SDavid Schultz.Cl
94e4afa19cSDavid Schultzcacos	arc cosine
95e4afa19cSDavid Schultzcacosh	arc hyperbolic cosine
96e4afa19cSDavid Schultzcasin	arc sine
97e4afa19cSDavid Schultzcasinh	arc hyperbolic sine
98e4afa19cSDavid Schultzcatan	arc tangent
99e4afa19cSDavid Schultzcatanh	arc hyperbolic tangent
1003daee1d6SDavid Schultzccos	cosine
1013daee1d6SDavid Schultzccosh	hyperbolic cosine
1026813d08fSMatt Macycpow	power function
1033daee1d6SDavid Schultzcsin	sine
1043daee1d6SDavid Schultzcsinh	hyperbolic sine
1053daee1d6SDavid Schultzctan	tangent
1063daee1d6SDavid Schultzctanh	hyperbolic tangent
1073daee1d6SDavid Schultz.El
10811725f21SMurray Stokely.Sh SEE ALSO
10911725f21SMurray Stokely.Xr fenv 3 ,
11011725f21SMurray Stokely.Xr ieee 3 ,
111c09eb466SJoel Dahl.Xr math 3 ,
11211725f21SMurray Stokely.Xr tgmath 3
11311725f21SMurray Stokely.Rs
11411725f21SMurray Stokely.%T "ISO/IEC 9899:TC3"
11511725f21SMurray Stokely.%U http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1256.pdf
11611725f21SMurray Stokely.Re
11711725f21SMurray Stokely.Sh STANDARDS
11811725f21SMurray StokelyThe
11911725f21SMurray Stokely.In complex.h
12011725f21SMurray Stokelyfunctions described here conform to
12111725f21SMurray Stokely.St -isoC-99 .
122*046e2d5dSSteve Kargl.Sh BUGS
123*046e2d5dSSteve KarglThe power functions,
124*046e2d5dSSteve Kargl.Fn cpowf, cpow ,
125*046e2d5dSSteve Kargland
126*046e2d5dSSteve Kargl.Fn cpowl ,
127*046e2d5dSSteve Karglare implemented, but the code was neither reviewed nor tested.
128