Openlibm: Difference between revisions

Jump to navigation Jump to search
598 bytes removed ,  28 July 2022
no edit summary
No edit summary
Line 50: Line 50:
*;CODE SOURCE:
*;CODE SOURCE:


<syntaxhighlight lang="C++">
#include <complex>
#include <limits>
#include <iostream>


int
main (int argc, char *argv[])
{
  double x = 10.0;
  std::complex<double> y (std::numeric_limits<double>::infinity (), 1.0);
  std::complex<double> z1 = std::pow (x, y);
  std::complex<double> z2 = std::pow (std::complex<double> (x), y);
  std::complex<double> z3 = std::exp (y * std::log (x));
  std::complex<double> z4 = std::exp (y * std::log (std::complex<double> (x)));
  std::cout << z1 << ", "
            << z2 << ", "
            << z3 << ", "
            << z4 << std::endl;
}
</syntaxhighlight>




Navigation menu