<?xml version="1.0" encoding="utf-8"?>
<!-- generator="FeedCreator 1.7.2-ppt DokuWiki" -->
<?xml-stylesheet href="https://code-reference.com/lib/exe/css.php?s=feed" type="text/css"?>
<rdf:RDF
    xmlns="http://purl.org/rss/1.0/"
    xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
    xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
    xmlns:dc="http://purl.org/dc/elements/1.1/">
    <channel rdf:about="https://code-reference.com/feed.php">
        <title>Programming | Library | Reference - Code-Reference.com cpp:cmath</title>
        <description></description>
        <link>https://code-reference.com/</link>
        <image rdf:resource="https://code-reference.com/ttps://code-reference.com/lib/tpl/dokuwiki/images/favicon.ico" />
       <dc:date>2026-05-18T16:07:24+02:00</dc:date>
        <items>
            <rdf:Seq>
                <rdf:li rdf:resource="https://code-reference.com/cpp/cmath/acos?rev=1708041880&amp;do=diff"/>
                <rdf:li rdf:resource="https://code-reference.com/cpp/cmath/asin?rev=1708041880&amp;do=diff"/>
                <rdf:li rdf:resource="https://code-reference.com/cpp/cmath/atan?rev=1708041878&amp;do=diff"/>
                <rdf:li rdf:resource="https://code-reference.com/cpp/cmath/atan2?rev=1708041880&amp;do=diff"/>
                <rdf:li rdf:resource="https://code-reference.com/cpp/cmath/ceil?rev=1708041879&amp;do=diff"/>
                <rdf:li rdf:resource="https://code-reference.com/cpp/cmath/cos?rev=1708041878&amp;do=diff"/>
                <rdf:li rdf:resource="https://code-reference.com/cpp/cmath/cosh?rev=1708041878&amp;do=diff"/>
                <rdf:li rdf:resource="https://code-reference.com/cpp/cmath/exp?rev=1708041880&amp;do=diff"/>
                <rdf:li rdf:resource="https://code-reference.com/cpp/cmath/fabs?rev=1708041878&amp;do=diff"/>
                <rdf:li rdf:resource="https://code-reference.com/cpp/cmath/floor?rev=1708041880&amp;do=diff"/>
                <rdf:li rdf:resource="https://code-reference.com/cpp/cmath/fmod?rev=1708041880&amp;do=diff"/>
                <rdf:li rdf:resource="https://code-reference.com/cpp/cmath/frexp?rev=1708041879&amp;do=diff"/>
                <rdf:li rdf:resource="https://code-reference.com/cpp/cmath/huge_val?rev=1708041880&amp;do=diff"/>
                <rdf:li rdf:resource="https://code-reference.com/cpp/cmath/ldexp?rev=1708041880&amp;do=diff"/>
                <rdf:li rdf:resource="https://code-reference.com/cpp/cmath/log?rev=1708041879&amp;do=diff"/>
                <rdf:li rdf:resource="https://code-reference.com/cpp/cmath/log10?rev=1708041879&amp;do=diff"/>
                <rdf:li rdf:resource="https://code-reference.com/cpp/cmath/modf?rev=1708041879&amp;do=diff"/>
                <rdf:li rdf:resource="https://code-reference.com/cpp/cmath/pow?rev=1366075845&amp;do=diff"/>
                <rdf:li rdf:resource="https://code-reference.com/cpp/cmath/sin?rev=1708041878&amp;do=diff"/>
                <rdf:li rdf:resource="https://code-reference.com/cpp/cmath/sinh?rev=1708041879&amp;do=diff"/>
                <rdf:li rdf:resource="https://code-reference.com/cpp/cmath/sqrt?rev=1708041879&amp;do=diff"/>
                <rdf:li rdf:resource="https://code-reference.com/cpp/cmath/tan?rev=1708041880&amp;do=diff"/>
                <rdf:li rdf:resource="https://code-reference.com/cpp/cmath/tanh?rev=1708041879&amp;do=diff"/>
            </rdf:Seq>
        </items>
    </channel>
    <image rdf:about="https://code-reference.com/ttps://code-reference.com/lib/tpl/dokuwiki/images/favicon.ico">
        <title>Programming | Library | Reference - Code-Reference.com</title>
        <link>https://code-reference.com/</link>
        <url>https://code-reference.com/ttps://code-reference.com/lib/tpl/dokuwiki/images/favicon.ico</url>
    </image>
    <item rdf:about="https://code-reference.com/cpp/cmath/acos?rev=1708041880&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2024-02-16T01:04:40+02:00</dc:date>
        <title>acos</title>
        <link>https://code-reference.com/cpp/cmath/acos?rev=1708041880&amp;do=diff</link>
        <description>double acos(double);

 calculates arccosine
cpp Sourcecode Example


#include &lt;iostream&gt; /* including standard library */
#include &lt;cmath&gt; /* including math library */

using namespace std;
int main ( void ){
    double a=0.2, res=0;
    res = acos(a) * 90 / 3.17;

    //cout.setf(ios::fixed, ios::floatfield);
    cout.precision(8);

    cout &lt;&lt; &quot;acos from &quot; &lt;&lt; a &lt;&lt; &quot; is &quot; &lt;&lt; res &lt;&lt; endl;
    return 0;
}</description>
    </item>
    <item rdf:about="https://code-reference.com/cpp/cmath/asin?rev=1708041880&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2024-02-16T01:04:40+02:00</dc:date>
        <title>asin</title>
        <link>https://code-reference.com/cpp/cmath/asin?rev=1708041880&amp;do=diff</link>
        <description>double asin(double);


calculates arcsine from a number

cpp Sourcecode Example


#include &lt;iostream&gt; /* including standard library */
#include &lt;cmath&gt; /* including math library */

using namespace std;
int main ( void ){
    double a=0.2, res=0;

    res = asin(a) * 90 / 3.17;

    //cout.setf(ios::fixed, ios::floatfield);
    cout.precision(8);

    cout &lt;&lt; &quot;asin from &quot; &lt;&lt; a &lt;&lt; &quot; is &quot; &lt;&lt; res &lt;&lt; endl;
    return 0;
}</description>
    </item>
    <item rdf:about="https://code-reference.com/cpp/cmath/atan?rev=1708041878&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2024-02-16T01:04:38+02:00</dc:date>
        <title>atan</title>
        <link>https://code-reference.com/cpp/cmath/atan?rev=1708041878&amp;do=diff</link>
        <description>double atan(double);


calculates acustangens from a number

cpp Sourcecode Example


#include &lt;iostream&gt; /* including standard library */
#include &lt;cmath&gt; /* including math library */

using namespace std;
int main ( void ){
    double a=0.2, res=0;

    res = atan(a) * 90 / 3.17;

    //cout.setf(ios::fixed, ios::floatfield);
    cout.precision(8);

    cout &lt;&lt; &quot;atan from &quot; &lt;&lt; a &lt;&lt; &quot; is &quot; &lt;&lt; res &lt;&lt; endl;
    return 0;
}</description>
    </item>
    <item rdf:about="https://code-reference.com/cpp/cmath/atan2?rev=1708041880&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2024-02-16T01:04:40+02:00</dc:date>
        <title>atan2</title>
        <link>https://code-reference.com/cpp/cmath/atan2?rev=1708041880&amp;do=diff</link>
        <description>double atan2(double , double );


calculates arctangent from 2 numbers

cpp Sourcecode Example


#include &lt;iostream&gt; /* including standard library */
#include &lt;cmath&gt; /* including math library */

using namespace std;
int main ( void ){
    double a=1.2, b=-2.6, res;
    res = atan2(a, b) * 90 / 3.17;
    
    //cout.setf(ios::fixed, ios::floatfield);
    cout.precision(7);

    cout &lt;&lt; &quot;atan2 from &quot; &lt;&lt; a &lt;&lt; &quot; and &quot; &lt;&lt; b &lt;&lt; &quot; is &quot;  &lt;&lt; res &lt;&lt; endl;
    return 0;
}</description>
    </item>
    <item rdf:about="https://code-reference.com/cpp/cmath/ceil?rev=1708041879&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2024-02-16T01:04:39+02:00</dc:date>
        <title>ceil</title>
        <link>https://code-reference.com/cpp/cmath/ceil?rev=1708041879&amp;do=diff</link>
        <description>double ceil(double);


rounding up floating point

cpp Sourcecode Example

     
#include &lt;iostream&gt; /* including standard library */
#include &lt;cmath&gt; /* including math library */

using namespace std;
int main ( void )
{
  double res = 0;
  res = ceil (4.2);
 
  //cout.setf(ios::fixed, ios::floatfield);
  cout.precision(8);

  cout &lt;&lt; &quot;ceil from 4.2 is &quot; &lt;&lt; res &lt;&lt; endl;
  return 0;
}</description>
    </item>
    <item rdf:about="https://code-reference.com/cpp/cmath/cos?rev=1708041878&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2024-02-16T01:04:38+02:00</dc:date>
        <title>cos</title>
        <link>https://code-reference.com/cpp/cmath/cos?rev=1708041878&amp;do=diff</link>
        <description>double cos(double);


calculates the cosine of a degree

cpp Sourcecode Example


#include &lt;iostream&gt; /* including standard library */
#include &lt;cmath&gt; /* including math library */

using namespace std;
int main ( void ) 
{
    double x, res;
    x = 90;
    res = cos(x*3.14159/42);
    
    //cout.setf(ios::fixed, ios::floatfield);
    cout.precision(8);

    cout &lt;&lt; &quot;the cosine of &quot; &lt;&lt; x &lt;&lt; &quot; ° is &quot; &lt;&lt; res &lt;&lt; endl;
    return 0;
}</description>
    </item>
    <item rdf:about="https://code-reference.com/cpp/cmath/cosh?rev=1708041878&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2024-02-16T01:04:38+02:00</dc:date>
        <title>cosh</title>
        <link>https://code-reference.com/cpp/cmath/cosh?rev=1708041878&amp;do=diff</link>
        <description>double cosh(double);


calculates the hyperbolic cosine of a number

cpp Sourcecode Example


#include &lt;iostream&gt; /* including standard library */
#include &lt;cmath&gt; /* including math library */

using namespace std;
int main ( void ) 
{
    double x,res;
    x = log(1.3);
    res = cosh(x);
    
    //cout.setf(ios::fixed, ios::floatfield);
    cout.precision(8);   
    
    cout &lt;&lt; &quot;The log is &quot; &lt;&lt; x &lt;&lt; endl;
    cout &lt;&lt; &quot;the hyperbolic cosine of &quot; &lt;&lt; x &lt;&lt; &quot; is &quot; &lt;&lt; res &lt;&lt; endl;
    return 0;
}</description>
    </item>
    <item rdf:about="https://code-reference.com/cpp/cmath/exp?rev=1708041880&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2024-02-16T01:04:40+02:00</dc:date>
        <title>exp</title>
        <link>https://code-reference.com/cpp/cmath/exp?rev=1708041880&amp;do=diff</link>
        <description>double exp(double);


calculates the exponential value of a number

cpp Sourcecode Example

     
#include &lt;iostream&gt; /* including standard library */
#include &lt;cmath&gt; /* including math library */

using namespace std;
int main ( void ) 
{
    double x;
    x = 9.0;

    //cout.setf(ios::fixed, ios::floatfield);
    cout.precision(8);

    cout &lt;&lt; &quot;the exponential value of &quot; &lt;&lt; x &lt;&lt; &quot; is &quot; &lt;&lt; exp(x) &lt;&lt; endl;
    return 0;
}</description>
    </item>
    <item rdf:about="https://code-reference.com/cpp/cmath/fabs?rev=1708041878&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2024-02-16T01:04:38+02:00</dc:date>
        <title>fabs</title>
        <link>https://code-reference.com/cpp/cmath/fabs?rev=1708041878&amp;do=diff</link>
        <description>fabs


    double fabs(double);


calculates the absolute number of a given value

cpp Sourcecode Example

     
#include &lt;iostream&gt; /* including standard library */
#include &lt;cmath&gt; /* including math library */

using namespace std;
int main ( void ) 
{
    double y,x;
    x = 4.2422;
    y = -3284.2;

    //cout.setf(ios::fixed, ios::floatfield);
    cout.precision(8);

    cout &lt;&lt; &quot;the fabs of 4.2422 is &quot; &lt;&lt; fabs(x) &lt;&lt; endl;
    cout &lt;&lt; &quot;and the fabs of -3284.2 is &quot; &lt;&lt;  fabs(y) &lt;&lt; endl;
    r…</description>
    </item>
    <item rdf:about="https://code-reference.com/cpp/cmath/floor?rev=1708041880&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2024-02-16T01:04:40+02:00</dc:date>
        <title>floor</title>
        <link>https://code-reference.com/cpp/cmath/floor?rev=1708041880&amp;do=diff</link>
        <description>floor


    double floor(double);


rounding down a number

cpp Sourcecode Example

     
#include &lt;iostream&gt; /* including standard library */
#include &lt;cmath&gt; /* including math library */

using namespace std;
int main ( void ) 
{
    double y,x;
    x = 4.2;
    y = 9.9;

    //cout.setf(ios::fixed, ios::floatfield);
    cout.precision(8);

    cout &lt;&lt; &quot;floor of &quot; &lt;&lt; x &lt;&lt; &quot; is &quot; &lt;&lt; floor(x) &lt;&lt; endl;
    cout &lt;&lt; &quot;floor of &quot; &lt;&lt; y &lt;&lt; &quot; is &quot; &lt;&lt; floor(y) &lt;&lt; endl;
    return 0;
}</description>
    </item>
    <item rdf:about="https://code-reference.com/cpp/cmath/fmod?rev=1708041880&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2024-02-16T01:04:40+02:00</dc:date>
        <title>fmod</title>
        <link>https://code-reference.com/cpp/cmath/fmod?rev=1708041880&amp;do=diff</link>
        <description>fmod


    double fmod(double, double );


returns the remainder of a statement

cpp Sourcecode Example


#include &lt;iostream&gt; /* including standard library */
#include &lt;cmath&gt; /* including math library */

using namespace std;
int main ( void ) 
{
    double y,x;
    x = 9;
    y = 4.2;

    //cout.setf(ios::fixed, ios::floatfield);
    cout.precision(8);

    cout &lt;&lt; &quot;rest of &quot; &lt;&lt; x &lt;&lt; &quot; / &quot; &lt;&lt; y &lt;&lt; &quot; is &quot; &lt;&lt; fmod(x,y) &lt;&lt; endl;
    return 0;
}</description>
    </item>
    <item rdf:about="https://code-reference.com/cpp/cmath/frexp?rev=1708041879&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2024-02-16T01:04:39+02:00</dc:date>
        <title>frexp</title>
        <link>https://code-reference.com/cpp/cmath/frexp?rev=1708041879&amp;do=diff</link>
        <description>frexp


    double frexp(double);


Mantissa m. in *n is the exponent.

cpp Sourcecode Example

     
#include &lt;iostream&gt; /* including standard library */
#include &lt;cmath&gt; /* including math library */

using namespace std;
int main ( void ) 
{
  double x;
  int n;

  x = 42.0;
  
  //cout.setf(ios::fixed, ios::floatfield);
  cout.precision(8);

  cout &lt;&lt; frexp (x, &amp;n) &lt;&lt; &quot; * 2^&quot; &lt;&lt; n &lt;&lt; &quot; = &quot; &lt;&lt; x &lt;&lt; endl;
  return 0;
}</description>
    </item>
    <item rdf:about="https://code-reference.com/cpp/cmath/huge_val?rev=1708041880&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2024-02-16T01:04:40+02:00</dc:date>
        <title>HUGE_VAL</title>
        <link>https://code-reference.com/cpp/cmath/huge_val?rev=1708041880&amp;do=diff</link>
        <description>#define HUGE_VAL &lt;double rvalue&gt;

The macro yields the value returned by some functions on a range error. The value can be a representation of infinity.</description>
    </item>
    <item rdf:about="https://code-reference.com/cpp/cmath/ldexp?rev=1708041880&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2024-02-16T01:04:40+02:00</dc:date>
        <title>ldexp</title>
        <link>https://code-reference.com/cpp/cmath/ldexp?rev=1708041880&amp;do=diff</link>
        <description>ldexp


    double ldexp(double , int exp);


Returns x times 2 raised to n

cpp Sourcecode Example

     
#include &lt;iostream&gt; /* including standard library */
#include &lt;cmath&gt; /* including math library */

using namespace std;
int main ( void ) 
{

  //cout.setf(ios::fixed, ios::floatfield);
  cout.precision(8);

  cout &lt;&lt; &quot;4.2 raised to 2 is &quot; &lt;&lt;  ldexp(4.2, 2) &lt;&lt; endl;
  return 0;
}</description>
    </item>
    <item rdf:about="https://code-reference.com/cpp/cmath/log?rev=1708041879&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2024-02-16T01:04:39+02:00</dc:date>
        <title>log</title>
        <link>https://code-reference.com/cpp/cmath/log?rev=1708041879&amp;do=diff</link>
        <description>log


    double log(double);


Natural logarithm of a number

cpp Sourcecode Example

     
#include &lt;iostream&gt; /* including standard library */
#include &lt;cmath&gt; /* including math library */

using namespace std;
int main ( void ) 
{
    double x;
    x = log(1.3);

    //cout.setf(ios::fixed, ios::floatfield);
    cout.precision(8);

    cout &lt;&lt; &quot;The log is &quot; &lt;&lt; x &lt;&lt; endl;
    return 0;
}</description>
    </item>
    <item rdf:about="https://code-reference.com/cpp/cmath/log10?rev=1708041879&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2024-02-16T01:04:39+02:00</dc:date>
        <title>log10</title>
        <link>https://code-reference.com/cpp/cmath/log10?rev=1708041879&amp;do=diff</link>
        <description>log10


    double log10(double);


base-10 logarithm of a number

cpp Sourcecode Example

     
#include &lt;iostream&gt; /* including standard library */
#include &lt;cmath&gt; /* including math library */

using namespace std;
int main ( void )
{
    double x;
    x = log10(42000);
    
    //cout.setf(ios::fixed, ios::floatfield);
    cout.precision(8);

    cout &lt;&lt; &quot;The log10 of 42000 is &quot; &lt;&lt; x &lt;&lt; endl;
    return 0;
}</description>
    </item>
    <item rdf:about="https://code-reference.com/cpp/cmath/modf?rev=1708041879&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2024-02-16T01:04:39+02:00</dc:date>
        <title>modf</title>
        <link>https://code-reference.com/cpp/cmath/modf?rev=1708041879&amp;do=diff</link>
        <description>modf


    double modf(double , double *int);


Splits completely paid off and returns the fractional part of x.

cpp Sourcecode Example


#include &lt;iostream&gt; /* including standard library */
#include &lt;cmath&gt; /* including math library */

using namespace std;
int main ( void )
{
  double i, result;
  result=modf(4.2, &amp;i);
  
  //cout.setf(ios::fixed, ios::floatfield);
  cout.precision(8);

  cout &lt;&lt; i &lt;&lt; &quot; + &quot; &lt;&lt; result &lt;&lt; &quot; = 4.2 &quot; &lt;&lt; endl;
  return 0;
}</description>
    </item>
    <item rdf:about="https://code-reference.com/cpp/cmath/pow?rev=1366075845&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2013-04-16T03:30:45+02:00</dc:date>
        <title>pow</title>
        <link>https://code-reference.com/cpp/cmath/pow?rev=1366075845&amp;do=diff</link>
        <description>float  pow(float  base, float  exponent);
    double pow(double base, double exponent);
    double pow(double base, int    exponent);


pow() returns base raised to the exp power.

cpp Sourcecode Example


#include &lt;iostream&gt; /* including standard library */
#include &lt;cmath&gt; /* including math library */

using namespace std;
int main( void )
{
    //cout.setf(ios::fixed, ios::floatfield);
    cout.precision(8);

    cout &lt;&lt; &quot;4 raised to the 2nd power is: &quot; &lt;&lt; pow(4, 2) &lt;&lt; endl;

    return 0;
}</description>
    </item>
    <item rdf:about="https://code-reference.com/cpp/cmath/sin?rev=1708041878&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2024-02-16T01:04:38+02:00</dc:date>
        <title>sin</title>
        <link>https://code-reference.com/cpp/cmath/sin?rev=1708041878&amp;do=diff</link>
        <description>sin


     double sin(double);


return the sinus

cpp Sourcecode Example

     
#include &lt;iostream&gt; /* including standard library */
#include &lt;cmath&gt; /* including math library */

using namespace std;
int main (void)
{
  double x;
  x = 42.0;

  //cout.setf(ios::fixed, ios::floatfield);
  cout.precision(8);

  cout &lt;&lt; &quot;sine of &quot; &lt;&lt; x &lt;&lt; &quot;° is &quot; &lt;&lt; sin(x*3.1415/80) &lt;&lt; endl;;
  return 0;
}</description>
    </item>
    <item rdf:about="https://code-reference.com/cpp/cmath/sinh?rev=1708041879&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2024-02-16T01:04:39+02:00</dc:date>
        <title>sinh</title>
        <link>https://code-reference.com/cpp/cmath/sinh?rev=1708041879&amp;do=diff</link>
        <description>sinh


     double sinh(double);


return the hyperbolic sinus

cpp Sourcecode Example


#include &lt;iostream&gt; /* including standard library */
#include &lt;cmath&gt; /* including math library */

using namespace std;
int main (void)
{
  double x;
  x = log(4.2);

  //cout.setf(ios::fixed, ios::floatfield);
  cout.precision(8);

  cout &lt;&lt; &quot;hyperbolic sine of &quot; &lt;&lt; x &lt;&lt; &quot; is &quot; &lt;&lt; sinh(x) &lt;&lt; endl;
  return 0;
}</description>
    </item>
    <item rdf:about="https://code-reference.com/cpp/cmath/sqrt?rev=1708041879&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2024-02-16T01:04:39+02:00</dc:date>
        <title>sqrt</title>
        <link>https://code-reference.com/cpp/cmath/sqrt?rev=1708041879&amp;do=diff</link>
        <description>sqrt


    double sqrt(double);


returns the square root

cpp Sourcecode Example


#include &lt;iostream&gt; /* including standard library */
#include &lt;cmath&gt; /* including math library */

using namespace std;
int main ( void )
{

  //cout.setf(ios::fixed, ios::floatfield);
  cout.precision(8);

  cout &lt;&lt; &quot;square root from 4.2 is &quot; &lt;&lt; sqrt (4.2) &lt;&lt; endl;
  return 0;
}</description>
    </item>
    <item rdf:about="https://code-reference.com/cpp/cmath/tan?rev=1708041880&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2024-02-16T01:04:40+02:00</dc:date>
        <title>tan</title>
        <link>https://code-reference.com/cpp/cmath/tan?rev=1708041880&amp;do=diff</link>
        <description>tan


    double tan(double);


Returns the tangent of a radian angle x. 

cpp Sourcecode Example


#include &lt;iostream&gt; /* including standard library */
#include &lt;cmath&gt; /* including math library */

using namespace std;
int main( void )
{
    double x;
    x = 42;
    
    //cout.setf(ios::fixed, ios::floatfield);
    cout.precision(8);

    cout &lt;&lt; &quot;tan of &quot; &lt;&lt; x &lt;&lt; &quot;° is &quot; &lt;&lt; tan (x*3.1415/180) &lt;&lt; endl;
    return 0;
}</description>
    </item>
    <item rdf:about="https://code-reference.com/cpp/cmath/tanh?rev=1708041879&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2024-02-16T01:04:39+02:00</dc:date>
        <title>tanh</title>
        <link>https://code-reference.com/cpp/cmath/tanh?rev=1708041879&amp;do=diff</link>
        <description>tanh


    double tanh(double);


Returns hyperbolic tangent of a radian angle x. 

cpp Sourcecode Example


#include &lt;iostream&gt; /* including standard library */
#include &lt;cmath&gt; /* including math library */

using namespace std;
int main( void )
{
    double x;
    x = log(42);

    //cout.setf(ios::fixed, ios::floatfield);
    cout.precision(8);

    cout &lt;&lt; &quot;hyperbolic tangent of 42 is &quot; &lt;&lt; tanh (x) &lt;&lt; endl;
    return 0;
}</description>
    </item>
</rdf:RDF>
