log10 - C complex.h

C examples for complex.h:log10

type

function template

From


<complex>
<complex.h>

Prototype

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

Description

Common logarithm of complex

Returns the common (base-10) logarithm of the complex number x :

log(x)/log(10)

Parameters

Parameter Description
x Complex value.

Return value

Common logarithm of x.

Demo Code


#include <iostream> // std::cout
#include <complex> // std::complex, std::imag

int main ()//from   w w w. j  a v a2 s  . c  o  m
{
  std::complex<double> mycomplex (20.0,2.0);

  std::cout << "Common logarithm: " << std::log10(mycomplex) << '\n';

  return 0;
}

Related Tutorials