Namespaces
Variants

std:: imag (std::complex)

From cppreference.net
헤더 파일에 정의됨 <complex>
(1)
template < class T >
T imag ( const std:: complex < T > & z ) ;
(C++14까지)
template < class T >
constexpr T imag ( const std:: complex < T > & z ) ;
(C++14부터)
추가 오버로드 (C++11부터)
헤더 파일에 정의됨 <complex>
(A)
float imag ( float f ) ;

double imag ( double f ) ;

long double imag ( long double f ) ;
(C++14까지)
constexpr float imag ( float f ) ;

constexpr double imag ( double f ) ;

constexpr long double imag ( long double f ) ;
(C++14부터)
(C++23까지)
template < class FloatingPoint >
FloatingPoint imag ( FloatingPoint f ) ;
(C++23부터)
(B)
template < class Integer >
double imag ( Integer i ) ;
(C++14까지)
template < class Integer >
constexpr double imag ( Integer i ) ;
(C++14부터)
1) 복소수의 허수부를 반환합니다 z , 즉 z. imag ( ) .
A,B) 모든 정수 및 부동소수점 타입에 대해 추가 오버로드가 제공되며, 이들은 허수부가 0인 복소수로 처리됩니다.
(since C++11)

목차

매개변수

z - 복소수 값
f - 부동소수점 값
i - 정수 값

반환값

1) z 의 허수부.
A) decltype ( f ) { } (영).
B) 0.0 .

참고 사항

추가 오버로드는 반드시 (A,B) 형태로 정확히 제공될 필요는 없습니다. 이들은 단지 해당 인수 num 에 대해 다음을 보장할 수 있을 만큼 충분하기만 하면 됩니다:

  • 만약 num 표준 (C++23 이전) 부동소수점 타입 T 를 가지면, std :: imag ( num ) std :: imag ( std:: complex < T > ( num ) ) 과 동일한 효과를 가집니다.
  • 그렇지 않고 num 이 정수 타입을 가지면, std :: imag ( num ) std :: imag ( std:: complex < double > ( num ) ) 과 동일한 효과를 가집니다.

참고 항목

복소수의 허수부에 접근
(public member function)
실수부를 반환
(function template)