std::imag(std::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) Technical Specifications

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
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)

 Defined in header `` template< class T > T imag( const complex& z ); (1) (until C++14) template< class T > constexpr T imag( const complex& 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

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