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.Dd November 3, 2021 26.Dt COMPLEX 3 27.Os 28.Sh NAME 29.Nm complex 30.Nd "complex arithmetic" 31.Sh LIBRARY 32.Lb libm 33.Sh SYNOPSIS 34.In complex.h 35.Sh DESCRIPTION 36These functions support complex arithmetic in the C math library. 37.Sh "LIST OF FUNCTIONS" 38Each of the following 39.Vt "double complex" 40functions has a 41.Vt "float complex" 42counterpart with an 43.Ql f 44appended to the name and a 45.Vt "long double complex" 46counterpart with an 47.Ql l 48appended. 49As an example, the 50.Vt "float complex" 51and 52.Vt "long double complex" 53counterparts of 54.Ft double 55.Fn cabs "double complex z" 56are 57.Ft float 58.Fn cabsf "float complex z" 59and 60.Ft "long double" 61.Fn cabsl "long double complex z" , 62respectively. 63.de Cl 64.Bl -column "csqrt" "complex absolute value (i.e., norm, modulus, magnitude)" 65.Em "Name Description" 66.. 67.\" Section 7.3.5 - 7.3.7 of ISO C99 standard unimplemented, see BUGS 68.\" Section 7.3.8 of ISO C99 standard 69.Ss Absolute-value Functions 70.Cl 71cabs complex absolute value (i.e., norm, modulus, magnitude) 72csqrt complex square root 73.El 74.Ss Exponential Function 75.Cl 76cexp exponential base e 77.El 78.Ss Natural logarithm Function 79.Cl 80clog natural logarithm 81.El 82.\" Section 7.3.9 of ISO C99 standard 83.Ss Manipulation Functions 84.Cl 85carg compute the argument (i.e., phase angle) 86cimag compute the imaginary part 87conj compute the complex conjugate 88cproj compute projection onto Riemann sphere 89creal compute the real part 90.El 91.\" Section 7.3.5-6 of ISO C99 standard 92.Ss Trigonometric and Hyperbolic Functions 93.Cl 94cacos arc cosine 95cacosh arc hyperbolic cosine 96casin arc sine 97casinh arc hyperbolic sine 98catan arc tangent 99catanh arc hyperbolic tangent 100ccos cosine 101ccosh hyperbolic cosine 102cpow power function 103csin sine 104csinh hyperbolic sine 105ctan tangent 106ctanh hyperbolic tangent 107.El 108.Sh SEE ALSO 109.Xr fenv 3 , 110.Xr ieee 3 , 111.Xr math 3 , 112.Xr tgmath 3 113.Rs 114.%T "ISO/IEC 9899:TC3" 115.%U http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1256.pdf 116.Re 117.Sh STANDARDS 118The 119.In complex.h 120functions described here conform to 121.St -isoC-99 . 122.Sh BUGS 123The power functions, 124.Fn cpowf, cpow , 125and 126.Fn cpowl , 127are implemented, but the code was neither reviewed nor tested. 128