Scroll to navigation

std::imag(std::complex)(3) C++ Standard Libary std::imag(std::complex)(3)

NAME

std::imag(std::complex) - std::imag(std::complex)

Synopsis


Defined in header <complex>
template< class T > (until C++14)
T imag( const std::complex<T>& z );
template< class T > (since C++14)
constexpr T imag( const std::complex<T>& z );
float imag( float z );


template< class DoubleOrInteger > (since C++11)
double imag( DoubleOrInteger z ); (1) (until C++14)


long double imag( long double z ); (2)
constexpr float imag( float z );


template< class DoubleOrInteger > (since C++14)
constexpr double imag( DoubleOrInteger z );


constexpr long double imag( long double z );


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


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

Parameters


z - complex value

Return value


The imaginary component of z.

See also


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

2022.07.31 http://cppreference.com