std::complex::imag

From cppreference.com
< cpp‎ | numeric‎ | complex
primary template complex<T>
T imag() const;
(1) (until C++14)
constexpr T imag() const;
(1) (since C++14)
void imag( T value );
(2)
specialization complex<float>
float imag() const;
(1) (until C++11)
constexpr float imag();
(1) (since C++11)
(until C++14)
constexpr float imag() const;
(1) (since C++14)
void imag( float value );
(2)
specialization complex<double>
double imag() const;
(1) (until C++11)
constexpr double imag();
(1) (since C++11)
(until C++14)
constexpr double imag() const;
(1) (since C++14)
void imag( double value );
(2)
specialization complex<long double>
long double imag() const;
(1) (until C++11)
constexpr long double imag();
(1) (since C++11)
(until C++14)
constexpr long double imag() const;
(1) (since C++14)
void imag( long double value );
(2)

Accesses the imaginary part of the complex number.

1) Returns the imaginary part.
2) Sets the imaginary part to value.

[edit] Parameters

value - the value to set the imaginary part to

[edit] See also

returns the imaginary component
(function template)
accesses the real part of the complex number
(public member function)