# std::complex::complex

< cpp‎ | numeric‎ | complex

C++
 Language Standard library headers Concepts Utilities library Strings library Containers library Algorithms library Iterators library Numerics library Input/output library Localizations library Regular expressions library (C++11) Atomic operations library (C++11) Thread support library (C++11)

Numerics library
 Common mathematical functions Floating-point environment Complex numbers Numeric arrays Pseudo-random number generation Compile-time rational arithmetic (C++11) Generic numeric operations iota (C++11) accumulate inner_product adjacent_difference partial_sum

std::complex
Member functions
complex::complex
Non-member functions
 real imag abs arg norm conj proj (C++11) polar operator""ioperator""ifoperator""il (C++14)(C++14)(C++14)
Exponential functions
Power functions
Trigonometric functions
 asin (C++11) acos (C++11) atan (C++11)
Hyperbolic functions
 asinh (C++11) acosh (C++11) atanh (C++11)

 primary template complex complex( const T& re = T(), const T& im = T() ); (1) (until C++14) constexpr complex( const T& re = T(), const T& im = T() ); (1) (since C++14) complex( const complex& other ); (2) (until C++14) constexpr complex( const complex& other ); (2) (since C++14) template< class X > complex( const complex& other); (3) (until C++14) template< class X > constexpr complex( const complex&  other); (3) (since C++14) specialization complex complex(float re = 0.0f, float im = 0.0f); (1) (until C++11) constexpr complex(float re = 0.0f, float im = 0.0f); (1) (since C++11) explicit complex(const complex& other); explicit complex(const complex& other); (3) (until C++11) explicit constexpr complex(const complex& other); explicit constexpr complex(const complex& other); (3) (since C++11) specialization complex complex(double re = 0.0, double im = 0.0); (1) (until C++11) constexpr complex(double re = 0.0, double im = 0.0); (1) (since C++11) complex(const complex& other); explicit complex(const complex& other); (3) (until C++11) constexpr complex(const complex& other); explicit constexpr complex(const complex& other); (3) (since C++11) specialization complex complex(long double re = 0.0L, long double im = 0.0L); (1) (until C++11) constexpr complex(long double re = 0.0L, long double im = 0.0L); (1) (since C++11) complex(const complex& other); complex(const complex& other); (3) (until C++11) constexpr complex(const complex& other); constexpr complex(const complex& other); (3) (since C++11)

Constructs the std::complex object.

1) Constructs the complex number from real and imaginary parts.
2) Copy constructor. Constructs the object with the copy of the contents of other. The copy constructor is implicit in the standard specializations.
3) Converting constructor. Constructs the object from a complex number of a different type.

### Parameters

 re - the real part im - the imaginary part other - another complex to use as source