Namespaces
Variants
Views
Actions

std::imag(std::complex)

From cppreference.com
< cpp‎ | numeric‎ | complex
Revision as of 08:42, 15 September 2013 by 46.193.164.201 (Talk)

 
 
 
 
Defined in header <complex>
template< class T >
T imag( const complex<T>& z );
(1) (until C++14)
template< class T >
constexpr T imag( const complex<T>& z );
(1) (since C++14)
long double imag( long double z );
(2) (since C++11)
template< class DoubleOrIngeter >
double imag( DoubleOrInteger z );
(3) (since C++11)
float imag( float z );
(4) (since C++11)

Returns the imaginary component of the complex number z, i.e. z.imag().

Additional overloads are provided for float, double, long double, and all integer types, which are treated as complex numbers with zero imaginary component.(since C++11)

Parameters

z - complex value

Return value

the imaginary component of z

See also

accesses the imaginary part of the complex number
(public member function) [edit]
accesses the real part of the complex number
(public member function) [edit]
returns the real part
(function template) [edit]