complex(3)

complex3

Complex arithmetic

Usage

#include <complex.h>

Library

Math Library (libm, -lm)

Overview

These functions support complex arithmetic in the C math library.

List of functions

Each of the following double complex functions has a float complex counterpart with an ‘f’ appended to the name and a long double complex counterpart with an ‘l’ appended. As an example, the float complex and long double complex counterparts of double cabs(double complex z) are float cabsf(float complex z) and long double cabsl(long double complex z), respectively.

Absolute-value Functions

Name Description cabs complex absolute value (i.e., norm, modulus, magnitude) csqrt complex square root

Exponential Function

Name Description cexp exponential base e

Natural logarithm Function

Name Description clog natural logarithm

Manipulation Functions

Name Description carg compute the argument (i.e., phase angle) cimag compute the imaginary part conj compute the complex conjugate cproj compute projection onto Riemann sphere creal compute the real part

Trigonometric and Hyperbolic Functions

Name Description cacos arc cosine cacosh arc hyperbolic cosine casin arc sine casinh arc hyperbolic sine catan arc tangent catanh arc hyperbolic tangent ccos cosine ccosh hyperbolic cosine cpow power function csin sine csinh hyperbolic sine ctan tangent ctanh hyperbolic tangent

Releases

36 releases since FreeBSD 8.3-RELEASE; the text changed 23 times.

  1. 8.3
  2. 8.4
  3. 9.0
  4. 9.1
  5. 9.2
  6. 9.3
  7. 10.0
  8. 10.1
  9. 10.2
  10. 10.3
  11. 10.4
  12. 11.0
  13. 11.1
  14. 11.2
  15. 11.3
  16. 11.4
  17. 12.0
  18. 12.1
  19. 12.2
  20. 12.3
  21. 12.4
  22. 13.0
  23. 13.1–13.2
  24. 13.3–16.0

Standards

The ⟨complex.h⟩ functions described here conform to ISO/IEC 9899:1999 (“ISO C99”).

Bugs

The power functions, cpowf,(cpow), and cpowl(), are implemented, but the code was neither reviewed nor tested.

From base 16.0-CURRENT-20261027-61c70dc16a79 in FreeBSD 16.0-CURRENT (2026-10-27). Parsed by carta from the page's mdoc source.