# Complex number arithmetic

< c‎ | numeric

C
 Language headers Type support Dynamic memory management Error handling Program utilities Variadic function support Date and time utilities Strings library Algorithms Numerics Input/output support Localization support Thread support (C11) Atomic operations (C11) Technical Specifications

Numerics
 Common mathematical functions Floating-point environment Complex number arithmetics Random number generation Type-generic math

Complex number arithmetic
 Types and the imaginary constant Manipulation Power and exponential functions Trigonometric functions Hyperbolic functions

The header `<complex.h>` defines macros and declares functions that support complex number arithmetic. Complex values are values of type `double complex`, `float complex`, `long double complex`,

If the macro constant `__STDC_IEC_559_COMPLEX__`(C99) is defined by the compiler, in addition to the complex types, the imaginary types are also supported: `double imaginary`, `float imaginary`, and `long double imaginary`. When a value of imaginary type is converted to a value of complex type, the resulting complex type has its real component set to zero. When a value of complex type is converted to a value of imaginary type, the real component is discarded.

Standard arithmetic operators +, -, *, / can be used with real, complex, and imaginary types in any combination.

If the macro constant `__STDC_NO_COMPLEX__`(C11) is defined by the compiler, the header `<complex.h>` and all of the names listed here are not provided.

If #pragma STDC CX_LIMITED_RANGE on is used, complex multiplication, division, and absolute value may use simplified mathematical formulas, despite the possibility of intermediate overflow.

Template:c/numeric/complex/dcl list complexTemplate:c/numeric/complex/dcl list Complex ITemplate:c/numeric/complex/dcl list imaginaryTemplate:c/numeric/complex/dcl list Imaginary ITemplate:c/numeric/complex/dcl list ITemplate:c/numeric/complex/dcl list CMPLXTemplate:c/numeric/complex/dcl list cimagTemplate:c/numeric/complex/dcl list crealTemplate:c/numeric/complex/dcl list cargTemplate:c/numeric/complex/dcl list conjTemplate:c/numeric/complex/dcl list cprojTemplate:c/numeric/complex/dcl list cabsTemplate:c/numeric/complex/dcl list cexpTemplate:c/numeric/complex/dcl list clogTemplate:c/numeric/complex/dcl list cpowTemplate:c/numeric/complex/dcl list csqrtTemplate:c/numeric/complex/dcl list cacosTemplate:c/numeric/complex/dcl list casinTemplate:c/numeric/complex/dcl list catanTemplate:c/numeric/complex/dcl list ccosTemplate:c/numeric/complex/dcl list csinTemplate:c/numeric/complex/dcl list ctanTemplate:c/numeric/complex/dcl list cacoshTemplate:c/numeric/complex/dcl list casinhTemplate:c/numeric/complex/dcl list catanhTemplate:c/numeric/complex/dcl list ccoshTemplate:c/numeric/complex/dcl list csinhTemplate:c/numeric/complex/dcl list ctanh
Defined in header `<complex.h>`