complex.h

This is an old revision of this page, as edited by BOT-Superzerocool (talk | contribs) at 23:32, 18 September 2009 (robot Adding: es:Complex.h). 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.[1] These functions use the built-in type complex which was introduced with the C99 revision of C.

This header should not be confused with the C++ standard library header <complex>, which implements complex numbers in a completely different way (as a template class, complex<T>).

Functions

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.[2]

References

  1. ^ complex.h: complex arithmetic – Base Definitions Reference, The Single UNIX Specification, Version 5 from The Open Group
  2. ^ cproj: complex projection function – System Interfaces Reference, The Single UNIX Specification, Version 5 from The Open Group