/*
    Demonstrates a few cmath functions    See Nyhoff P 90
    For all details: http://www.cplusplus.com/reference/cmath/
*/

#include <iostream>
#include <cmath>                  // See table P90.

using namespace std;

int main()
{
   double x=3.0;
   
   cout << "fabs(x)=   " << fabs(x)    << endl;    // floating point |x|
   cout << "sqrt(x)=   " << sqrt(x)    << endl;    // square root
   cout << "pow(x,3.5)=" << pow(x,3.5) << endl;    // x^3.5
   cout << "log(x)=    " << log(x)     << endl;    // natural logarithm
   cout << "log10(x)=  " << log10(x)   << endl;    // base 10 logarithm
   cout << "sin(x)=    " << sin(x)     << endl;    // Trigonometrics always uses radians
   cout << "cosh(x)=   " << cosh(x)    << endl;    // hyperbolic cos
}
