NAME
ccoommpplleexx - complex floating-point functions
SYNOPSIS
##iinncclluuddee <
> DESCRIPTION
The header file complex.h provides function prototypes and macros for
working with C99 complex floating-point values. The functions conform to
the ISO/IEC 9899:1999(E) standard. In particular, arguments with infi-
nite real or imaginary parts are regarded as infinities, even if the other part is a NaN.complex.h defines the macro complex for use as a type specifier, and the
macro I to be the imaginary unit, which can be used to construct complex
floating-point numbers from two real floating-point numbers. For exam-
ple:#include
double complex z = 1.0 + 1.0 * I; // z = 1 + i
Each of the functions that use complex floating-point values are provided
in single, double, and extended precision; the double precision proto-
types are listed here. The man pages for the individual functions pro-
vide more details on their use, special cases, and prototypes for their single and extended precision versions.The double-precision functions defined in complex.h are:
double ccrreeaall(double complex z)
double cciimmaagg(double complex z)
ccrreeaall() and cciimmaagg() take a complex floating-point number and return its
real and imaginary part, respectively, as real floating-point numbers.
double ccaabbss(double complex z)
double ccaarrgg(double complex z)
ccaabbss() and ccaarrgg() take a complex floating-point number and return its
norm and argument (phase angle), respectively, as real floating-point
numbers. They are used to convert between rectangular and polar coordi-
nates, and are fully specified in terms of real functions: cabs(x + iy) = hypot(x,y) carg(x + iy) = atan2(y,x)double complex ccoonnjj(double complex z)
ccoonnjj() takes a complex floating-point number and returns its complex con-
jugate.double complex ccpprroojj(double complex z)
ccpprroojj() takes a complex floating-point number and returns its projection
onto the Riemann sphere, as defined in C99. For non-infinite inputs, the
return value is equal to the input value.double complex ccssqqrrtt(double complex z)
ccssqqrrtt() takes a complex floating-point number and returns its square
root, with a branch cut on the negative real axis.double complex cceexxpp(double complex z)
double complex cclloogg(double complex z)
cceexxpp() and cclloogg() take a complex floating-point number and return its
base-e exponential and logarithm, respectively. cclloogg() has a branch cut
on the negative real axis.double complex ccppooww(double complex z, double complex w)
ccppooww() takes two complex floating-point numbers, and returns the first
raised to the power of the second, with a branch cut for the first param-
eter along the negative real axis.double complex ccssiinn(double complex z)
double complex ccccooss(double complex z)
double complex ccttaann(double complex z)
ccssiinn(), ccccooss(), and ccttaann() take a complex floating-point number and
return its sine, cosine, and tangent, respectively.double complex ccaassiinn(double complex z)
double complex ccaaccooss(double complex z)
double complex ccaattaann(double complex z)
ccaassiinn(), ccaaccooss(), and ccaattaann() take a complex floating-point number and
return its inverse sine, cosine, and tangent, respectively.ccaassiinn() and ccaaccooss() have branch cuts outside the interval [-1, 1] on the
real axis, and ccaattaann() has a branch cut outside the interval [-i, i] on
the imaginary axis.double complex ccssiinnhh(double complex z)
double complex ccccoosshh(double complex z)
double complex ccttaannhh(double complex z)
ccssiinnhh(), ccccoosshh(), and ccttaannhh() take a complex floating-point number and
return its hyperbolic sine, cosine, and tangent, respectively.double complex ccaassiinnhh(double complex z)
double complex ccaaccoosshh(double complex z)
double complex ccaattaannhh(double complex z)
ccaassiinnhh(), ccaaccoosshh(), and ccaattaannhh() take a complex floating-point number and
return its inverse hyperbolic sine, cosine, and tangent, respectively.ccaassiinnhh() has a branch cut outside the interval [-i, i] on the imaginary
axis. ccaaccoosshh() has a branch cut at values less than 1 on the real axis.ccaattaannhh() has a branch cut outside the interval [-1, 1] on the real axis.
NNOOTTEENote that the complex math functions are not, in general, equivalent to
their real counterparts for inputs on the real axis. For example,csqrt(-1 + 0i) is 0 + i, whereas sqrt(-1) is NaN.
SEE ALSO
cabs(3), cacos(3), cacosh(3), carg(3), casin(3), casinh(3), catan(3), catanh(3), ccos(3), ccosh(3), cexp(3), cimag(3), clog(3), conj(3), cpow(3), cproj(3), creal(3), csin(3), csinh(3), csqrt(3), ctan(3), ctanh(3), math(3) STANDARDSThe
BSD October 10, 2006 BSDfunctions conform to ISO/IEC 9899:1999(E).