Cpp-standard-library-cpp-complex-conj

提供:Dev Guides
移動先:案内検索

C ++複雑なライブラリ-Conj

説明

複素共役であり、複素数xの共役を返します。 複素数の共役は(real、-imag)です。

宣言

以下は、std
conjの宣言です。
template<class T> complex<T> conj (const complex<T>& x);

C 11

template<class T> complex<T> conj (const complex<T>& x);

パラメーター

*x* これは複雑な値です。

戻り値

複素数xの共役を返します。

例外

none

以下のstd
conjの例。
#include <iostream>
#include <complex>

int main () {
   std::complex<double> mycomplex (50.0,2.0);

   std::cout << "The conjugate of " << mycomplex << " is " << std::conj(mycomplex)
      << '\n';

   return 0;
}

サンプル出力は次のようになります-

The conjugate of (50,2) is (50,-2)