This manual page is for Mac OS X version 10.6.3

If you are running a different version of Mac OS X, view the documentation locally:

  • In Terminal, using the man(1) command

Reading manual pages

Manual pages are intended as a quick reference for people who already understand a technology.

  • For more information about the manual page format, see the manual page for manpages(5).

  • For more information about this technology, look for other documentation in the Apple Reference Library.

  • For general information about writing shell scripts, read Shell Scripting Primer.



COMPLEX(3)                              BSD Library Functions Manual                              COMPLEX(3)

NAME
     complex -- complex floating-point functions

SYNOPSIS
     #include <complex.h>

DESCRIPTION
     The header file complex.h provides function prototypes and macros for working with C99 complex float-ing-point floating-point
     ing-point values.  The functions conform to the ISO/IEC 9899:1999(E) standard.  In particular, argu-ments arguments
     ments with infinite 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 num-bers. numbers.
     bers.  For example:

           #include <complex.h>
           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 prototypes are listed here.  The man pages for the individual
     functions provide 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 creal(double complex z)

     double cimag(double complex z)

     creal() and cimag() take a complex floating-point number and return its real and imaginary part,
     respectively, as real floating-point numbers.

     double cabs(double complex z)

     double carg(double complex z)

     cabs() and carg() 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
     coordinates, and are fully specified in terms of real functions:

           cabs(x + iy) = hypot(x,y)
           carg(x + iy) = atan2(y,x)

     double complex conj(double complex z)

     conj() takes a complex floating-point number and returns its complex conjugate.

     double complex cproj(double complex z)

     cproj() 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 csqrt(double complex z)

     csqrt() takes a complex floating-point number and returns its square root, with a branch cut on the
     negative real axis.

     double complex cexp(double complex z)

     double complex clog(double complex z)

     cexp() and clog() take a complex floating-point number and return its base-e exponential and logarithm,
     respectively.  clog() has a branch cut on the negative real axis.

     double complex cpow(double complex z, double complex w)

     cpow() takes two complex floating-point numbers, and returns the first raised to the power of the sec-ond, second,
     ond, with a branch cut for the first parameter along the negative real axis.

     double complex csin(double complex z)

     double complex ccos(double complex z)

     double complex ctan(double complex z)

     csin(), ccos(), and ctan() take a complex floating-point number and return its sine, cosine, and tan-gent, tangent,
     gent, respectively.

     double complex casin(double complex z)

     double complex cacos(double complex z)

     double complex catan(double complex z)

     casin(), cacos(), and catan() take a complex floating-point number and return its inverse sine, cosine,
     and tangent, respectively.

     casin() and cacos() have branch cuts outside the interval [-1, 1] on the real axis, and catan() has a
     branch cut outside the interval [-i, i] on the imaginary axis.

     double complex csinh(double complex z)

     double complex ccosh(double complex z)

     double complex ctanh(double complex z)

     csinh(), ccosh(), and ctanh() take a complex floating-point number and return its hyperbolic sine,
     cosine, and tangent, respectively.

     double complex casinh(double complex z)

     double complex cacosh(double complex z)

     double complex catanh(double complex z)

     casinh(), cacosh(), and catanh() take a complex floating-point number and return its inverse hyperbolic
     sine, cosine, and tangent, respectively.

     casinh() has a branch cut outside the interval [-i, i] on the imaginary axis.  cacosh() has a branch
     cut at values less than 1 on the real axis.  catanh() has a branch cut outside the interval [-1, 1] on
     the real axis.

NOTE
     Note 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)

STANDARDS
     The <complex.h> functions conform to ISO/IEC 9899:1999(E).

BSD                                           December 11, 2006                                          BSD

Reporting Problems

The way to report a problem with this manual page depends on the type of problem:

Content errors
Report errors in the content of this documentation with the feedback links below.
Bug reports
Report bugs in the functionality of the described tool or API through Bug Reporter.
Formatting problems
Report formatting mistakes in the online version of these pages with the feedback links below.

Did this document help you? Yes It's good, but... Not helpful...