complex.h

This is an old revision of this page, as edited by Alksentrs (talk | contribs) at 16:35, 17 March 2009 (Function declarations: explain cproj). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.

complex.h is a header file in the standard library of the C programming language that defines functionality for complex arithmetic. These functions use the built-in type complex which was introduced with the C99 revision of C.

Function declarations

Each function declared in complex.h has three versions, each of which works with a different floating-point type (double, float and long double). Only the double version of each function is listed here; to use the float (or long double) version, append an f (or an l, respectively) to the function's name.

Note that all angles are in radians.

double         cabs(double complex); Complex magnitude
double complex cacos(double complex); Complex inverse cosine
double complex cacosh(double complex); Complex inverse hyperbolic cosine
double         carg(double complex); Complex argument
double complex casin(double complex); Complex inverse sine
double complex casinh(double complex); Complex inverse hyperbolic sine
double complex catan(double complex); Complex inverse tangent
double complex catanh(double complex); Complex inverse hyperbolic tangent
double complex ccos(double complex); Complex cosine
double complex ccosh(double complex); Complex hyperbolic cosine
double complex cexp(double complex); Complex exponential
double         cimag(double complex); Imaginary part of complex number
double complex clog(double complex); Complex logarithm
double complex conj(double complex); Complex conjugate
double complex cpow(double complex, double complex); Complex power
double complex cproj(double complex); Complex projection[A]
double         creal(double complex); Real part of complex number
double complex csin(double complex); Complex sine
double complex csinh(double complex); Complex hyperbolic sine
double complex csqrt(double complex); Complex square root
double complex ctan(double complex); Complex tangent
double complex ctanh(double complex); Complex hyperbolic tangent
A cproj(z) projects the complex number z onto the Riemann sphere; the result is z itself, except complex infinities are mapped to positive infinity on the real axis. [1]