Namespaces
Variants
Views
Actions

Complex number arithmetic

From cppreference.com
< c‎ | numeric
Revision as of 17:35, 31 May 2013 by P12bot (Talk | contribs)

 
 
 
Complex number arithmetic
Types and the imaginary constant
(C99)
(C99)    
(C11)
(C99)
Manipulation
(C99)
(C99)
(C99)
(C99)
(C99)
(C99)
Power and exponential functions
(C99)
(C99)
(C99)
(C99)
Trigonometric functions
(C99)
(C99)
(C99)
(C99)
(C99)
(C99)
Hyperbolic functions
(C99)
(C99)
(C99)
(C99)
(C99)
(C99)
 

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>

Contents

Types
The imaginary constant
Manipulation
Exponential functinos
Power functions
Trigonometric functions
Hyperbolic functions