共用方式為


log10

傳回複數的十進位對數。

template<class Type> 
   complex<Type> log10( 
      const complex<Type>& _ComplexNum 
   );

參數

  • _ComplexNum
    十進位) 來決定的複數。

傳回值

是輸入複數的十進位) 的複數。

備註

分支剪下是沿著負數真正的座標軸。

範例

// complex_log10.cpp
// compile with: /EHsc
#include <vector>
#include <complex>
#include <iostream>

int main() {
   using namespace std;
   double pi = 3.14159265359;
   complex <double> c1 ( 3.0 , 4.0 );
   cout << "Complex number c1 = " << c1 << endl;

   // Values of log10 of a complex number c1
   complex <double> c2 = log10 ( c1 );
   cout << "Complex number c2 = log10 ( c1 ) = " << c2 << endl;
   double absc2 = abs ( c2 );
   double argc2 = arg ( c2 );
   cout << "The modulus of c2 is: " << absc2 << endl;
   cout << "The argument of c2 is: "<< argc2 << " radians, which is " 
        << argc2 * 180 / pi << " degrees." << endl << endl; 

   // log10 of the standard angles  
   // in the first two quadrants of the complex plane
   vector <complex <double> > v1;
   vector <complex <double> >::iterator Iter1;
   complex <double> vc1  ( polar (1.0, pi / 6) );
   v1.push_back( log10 ( vc1 ) );
   complex <double> vc2  ( polar (1.0, pi / 3) );
   v1.push_back( log10 ( vc2 ) );
   complex <double> vc3  ( polar (1.0, pi / 2) );
   v1.push_back( log10 ( vc3) );
   complex <double> vc4  ( polar (1.0, 2 * pi / 3) );
   v1.push_back( log10 ( vc4 ) );
   complex <double> vc5  ( polar (1.0, 5 * pi / 6) );
   v1.push_back( log10 ( vc5 ) );
   complex <double> vc6  ( polar (1.0,  pi ) );
   v1.push_back( log10 ( vc6 ) );

   cout << "The complex components log10 (vci), where abs (vci) = 1"
        << "\n& arg (vci) = i * pi / 6 of the vector v1 are:\n" ;
   for ( Iter1 = v1.begin( ) ; Iter1 != v1.end( ) ; Iter1++ )
      cout << *Iter1 << endl;
}

範例輸出

Complex number c1 = (3,4)
Complex number c2 = log10 ( c1 ) = (0.69897,0.402719)
The modulus of c2 is: 0.806686
The argument of c2 is: 0.522706 radians, which is 29.9489 degrees.

The complex components log10 (vci), where abs (vci) = 1
& arg (vci) = i * pi / 6 of the vector v1 are:
(0,0.227396)
(0,0.454792)
(0,0.682188)
(0,0.909584)
(0,1.13698)
(0,-1.36438)

需求

標題: <複雜>

命名空間: std