<?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 c:math.h</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-06-21T05:30:46+02:00</dc:date>
        <items>
            <rdf:Seq>
                <rdf:li rdf:resource="https://code-reference.com/c/math.h/acos?rev=1708041937&amp;do=diff"/>
                <rdf:li rdf:resource="https://code-reference.com/c/math.h/asin?rev=1708041937&amp;do=diff"/>
                <rdf:li rdf:resource="https://code-reference.com/c/math.h/atan?rev=1708041935&amp;do=diff"/>
                <rdf:li rdf:resource="https://code-reference.com/c/math.h/atan2?rev=1708041937&amp;do=diff"/>
                <rdf:li rdf:resource="https://code-reference.com/c/math.h/ceil?rev=1708041936&amp;do=diff"/>
                <rdf:li rdf:resource="https://code-reference.com/c/math.h/cos?rev=1708041935&amp;do=diff"/>
                <rdf:li rdf:resource="https://code-reference.com/c/math.h/cosh?rev=1708041935&amp;do=diff"/>
                <rdf:li rdf:resource="https://code-reference.com/c/math.h/exp?rev=1708041937&amp;do=diff"/>
                <rdf:li rdf:resource="https://code-reference.com/c/math.h/fabs?rev=1708041935&amp;do=diff"/>
                <rdf:li rdf:resource="https://code-reference.com/c/math.h/floor?rev=1708041937&amp;do=diff"/>
                <rdf:li rdf:resource="https://code-reference.com/c/math.h/fmod?rev=1708041937&amp;do=diff"/>
                <rdf:li rdf:resource="https://code-reference.com/c/math.h/frexp?rev=1708041936&amp;do=diff"/>
                <rdf:li rdf:resource="https://code-reference.com/c/math.h/huge_val?rev=1708041936&amp;do=diff"/>
                <rdf:li rdf:resource="https://code-reference.com/c/math.h/ldexp?rev=1708041937&amp;do=diff"/>
                <rdf:li rdf:resource="https://code-reference.com/c/math.h/log?rev=1708041936&amp;do=diff"/>
                <rdf:li rdf:resource="https://code-reference.com/c/math.h/log10?rev=1708041935&amp;do=diff"/>
                <rdf:li rdf:resource="https://code-reference.com/c/math.h/modf?rev=1708041936&amp;do=diff"/>
                <rdf:li rdf:resource="https://code-reference.com/c/math.h/pow?rev=1708041937&amp;do=diff"/>
                <rdf:li rdf:resource="https://code-reference.com/c/math.h/sin?rev=1708041935&amp;do=diff"/>
                <rdf:li rdf:resource="https://code-reference.com/c/math.h/sinh?rev=1708041936&amp;do=diff"/>
                <rdf:li rdf:resource="https://code-reference.com/c/math.h/sqrt?rev=1708041936&amp;do=diff"/>
                <rdf:li rdf:resource="https://code-reference.com/c/math.h/tan?rev=1708041937&amp;do=diff"/>
                <rdf:li rdf:resource="https://code-reference.com/c/math.h/tanh?rev=1708041936&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/c/math.h/acos?rev=1708041937&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2024-02-16T01:05:37+02:00</dc:date>
        <title>acos</title>
        <link>https://code-reference.com/c/math.h/acos?rev=1708041937&amp;do=diff</link>
        <description>acos


    double acos(double);

 calculates arccosine
Linux: compile with gcc acos.c -o acos -lm -Wall   

C Sourcecode Example


#include &lt;stdio.h&gt; /* including standard library */
//#include &lt;windows.h&gt; /* uncomment this for Windows */

#include &lt;math.h&gt; /* including math library */

int main ( void ){
    double a=0.2;
    printf(&quot;acos from %f is %f\n&quot;, a, acos(a) * 90 / 3.17);
    return 0;
}</description>
    </item>
    <item rdf:about="https://code-reference.com/c/math.h/asin?rev=1708041937&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2024-02-16T01:05:37+02:00</dc:date>
        <title>asin</title>
        <link>https://code-reference.com/c/math.h/asin?rev=1708041937&amp;do=diff</link>
        <description>double asin(double);


calculates arcsine from a number

C Sourcecode Example

compile in linux with: gcc asin.c -o asin -lm -Wall


#include &lt;stdio.h&gt; /* including standard library */
//#include &lt;windows.h&gt; /* uncomment this for Windows */

#include &lt;math.h&gt; /* including math library */

int main ( void ){
    double a=0.2;
    printf(&quot;asin from %f is %f\n&quot;, a, asin(a) * 90 / 3.17);
    return 0;
}</description>
    </item>
    <item rdf:about="https://code-reference.com/c/math.h/atan?rev=1708041935&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2024-02-16T01:05:35+02:00</dc:date>
        <title>atan</title>
        <link>https://code-reference.com/c/math.h/atan?rev=1708041935&amp;do=diff</link>
        <description>atan


    double atan(double);


calculates acustangens from a number

C Sourcecode Example

compile in linux with: gcc atan.c -o atan -lm -Wall


#include &lt;stdio.h&gt; /* including standard library */
//#include &lt;windows.h&gt; /* uncomment this for Windows */

#include &lt;math.h&gt; /* including math library */

int main ( void ){
    double a=0.2;
    printf(&quot;atan from %f is %f\n&quot;, a, atan(a) * 90 / 3.17);
    return 0;
}</description>
    </item>
    <item rdf:about="https://code-reference.com/c/math.h/atan2?rev=1708041937&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2024-02-16T01:05:37+02:00</dc:date>
        <title>atan2</title>
        <link>https://code-reference.com/c/math.h/atan2?rev=1708041937&amp;do=diff</link>
        <description>atan2


    double atan2(double , double );


calculates arctangent from 2 numbers

C Sourcecode Example

compile in linux with: gcc atan2.c -o atan2 -lm -Wall


#include &lt;stdio.h&gt; /* including standard library */
//#include &lt;windows.h&gt; /* uncomment this for Windows */

#include &lt;math.h&gt; /* including math library */

int main ( void ){
    double a=1.2, b=-2.6;
    printf(&quot;atan2 from %f and %f is %f\n&quot;, a, b, atan2(a, b) * 90 / 3.17);
    return 0;
}</description>
    </item>
    <item rdf:about="https://code-reference.com/c/math.h/ceil?rev=1708041936&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2024-02-16T01:05:36+02:00</dc:date>
        <title>ceil</title>
        <link>https://code-reference.com/c/math.h/ceil?rev=1708041936&amp;do=diff</link>
        <description>double ceil(double);


rounding up floating point

C Sourcecode Example

compile in linux with: gcc ceil.c -o ceil -lm -Wall

     
#include &lt;stdio.h&gt; /* including standard library */
//#include &lt;windows.h&gt; /* uncomment this for Windows */

#include &lt;math.h&gt; /* including math library */

int main ()
{
  printf (&quot;ceil from 4.2 is %f\n&quot;, ceil (4.2) );
  return 0;
}</description>
    </item>
    <item rdf:about="https://code-reference.com/c/math.h/cos?rev=1708041935&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2024-02-16T01:05:35+02:00</dc:date>
        <title>cos</title>
        <link>https://code-reference.com/c/math.h/cos?rev=1708041935&amp;do=diff</link>
        <description>double cos(double);


calculates the cosine of a degree

C Sourcecode Example

compile in linux with: gcc cos.c -o cos -lm -Wall

     
#include &lt;stdio.h&gt; /* including standard library */
//#include &lt;windows.h&gt; /* uncomment this for Windows */

#include &lt;math.h&gt; /* including math library */

int main ( void ) 
{
double x;
x = 90;
printf(&quot;the cosine of %f ° is %f\n&quot;, x, cos(x*3.14159/42));
return 0;
}</description>
    </item>
    <item rdf:about="https://code-reference.com/c/math.h/cosh?rev=1708041935&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2024-02-16T01:05:35+02:00</dc:date>
        <title>cosh</title>
        <link>https://code-reference.com/c/math.h/cosh?rev=1708041935&amp;do=diff</link>
        <description>double cosh(double);


calculates the hyperbolic cosine of a number

C Sourcecode Example

compile in linux with: gcc cosh.c -o cosh -lm -Wall

     
#include &lt;stdio.h&gt; /* including standard library */
//#include &lt;windows.h&gt; /* uncomment this for Windows */

#include &lt;math.h&gt; /* including math library */

int main ( void ) 
{
double x;
x = log(1.3);
printf(&quot;The log is %f\n&quot;,x);
printf(&quot;the hyperbolic cosine of %f is %f\n&quot;, x, cosh(x));
return 0;
}</description>
    </item>
    <item rdf:about="https://code-reference.com/c/math.h/exp?rev=1708041937&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2024-02-16T01:05:37+02:00</dc:date>
        <title>exp</title>
        <link>https://code-reference.com/c/math.h/exp?rev=1708041937&amp;do=diff</link>
        <description>double exp(double);


calculates the exponential value of a number

C Sourcecode Example

compile in linux with: gcc exp.c -o exp -lm -Wall

     
#include &lt;stdio.h&gt; /* including standard library */
//#include &lt;windows.h&gt; /* uncomment this for Windows */

#include &lt;math.h&gt; /* including math library */

int main ( void ) 
{
double x;
x = 9.0;
printf(&quot;the exponential value of %f is %f\n&quot;, x, exp(x));
return 0;
}</description>
    </item>
    <item rdf:about="https://code-reference.com/c/math.h/fabs?rev=1708041935&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2024-02-16T01:05:35+02:00</dc:date>
        <title>fabs</title>
        <link>https://code-reference.com/c/math.h/fabs?rev=1708041935&amp;do=diff</link>
        <description>fabs


    double fabs(double);


calculates the absolute number of a given value

C Sourcecode Example

compile in linux with: gcc fabs.c -o fabs -lm -Wall

     
#include &lt;stdio.h&gt; /* including standard library */
//#include &lt;windows.h&gt; /* uncomment this for Windows */

#include &lt;math.h&gt; /* including math library */

int main ( void ) 
{
double y,x;
x = 4.2422;
y = -3284.2;
printf(&quot;the fabs of 4.2422 is %f\n&quot;, fabs(x) );
printf(&quot;and the fabs of -3284.2 is %f\n &quot;, fabs(y) );
return 0;
}</description>
    </item>
    <item rdf:about="https://code-reference.com/c/math.h/floor?rev=1708041937&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2024-02-16T01:05:37+02:00</dc:date>
        <title>floor</title>
        <link>https://code-reference.com/c/math.h/floor?rev=1708041937&amp;do=diff</link>
        <description>floor


    double floor(double);


rounding down a number

C Sourcecode Example

compile in linux with: gcc floor.c -o floor -lm -Wall

     
#include &lt;stdio.h&gt; /* including standard library */
//#include &lt;windows.h&gt; /* uncomment this for Windows */

#include &lt;math.h&gt; /* including math library */

int main ( void ) 
{
double y,x;
x = 4.2;
y = 9.9;
printf(&quot;floor of %f is %f\n&quot;, x, floor(x) );
printf(&quot;floor of %f is %f\n &quot;,y , floor(y) );
return 0;
}</description>
    </item>
    <item rdf:about="https://code-reference.com/c/math.h/fmod?rev=1708041937&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2024-02-16T01:05:37+02:00</dc:date>
        <title>fmod</title>
        <link>https://code-reference.com/c/math.h/fmod?rev=1708041937&amp;do=diff</link>
        <description>fmod


    double fmod(double, double );


returns the remainder of a statement

C Sourcecode Example

compile in linux with: gcc fmod.c -o fmod -lm -Wall

     
#include &lt;stdio.h&gt; /* including standard library */
//#include &lt;windows.h&gt; /* uncomment this for Windows */

#include &lt;math.h&gt; /* including math library */

int main ( void ) 
{
double y,x;
x = 9;
y = 4.2;
printf(&quot;rest of %f / %f is %f\n&quot;, x, y, fmod(x,y) );
return 0;
}</description>
    </item>
    <item rdf:about="https://code-reference.com/c/math.h/frexp?rev=1708041936&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2024-02-16T01:05:36+02:00</dc:date>
        <title>frexp</title>
        <link>https://code-reference.com/c/math.h/frexp?rev=1708041936&amp;do=diff</link>
        <description>frexp


    double frexp(double);


Mantissa m. in *n is the exponent.

C Sourcecode Example

compile in linux with: gcc frexp.c -o frexp -lm -Wall

     
#include &lt;stdio.h&gt; /* including standard library */
//#include &lt;windows.h&gt; /* uncomment this for Windows */

#include &lt;math.h&gt; /* including math library */

int main ( void ) 
{
  double x;
  int n;

  x = 42.0;
  printf (&quot;%lf * 2^%d = %f\n&quot;, frexp (x , &amp;n), n, x);
  return 0;
}</description>
    </item>
    <item rdf:about="https://code-reference.com/c/math.h/huge_val?rev=1708041936&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2024-02-16T01:05:36+02:00</dc:date>
        <title>HUGE_VAL</title>
        <link>https://code-reference.com/c/math.h/huge_val?rev=1708041936&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/c/math.h/ldexp?rev=1708041937&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2024-02-16T01:05:37+02:00</dc:date>
        <title>ldexp</title>
        <link>https://code-reference.com/c/math.h/ldexp?rev=1708041937&amp;do=diff</link>
        <description>ldexp


    double ldexp(double , int exp);


Returns x times 2 raised to n

C Sourcecode Example

compile in linux with: gcc ldexp.c -o ldexp -lm -Wall

     
#include &lt;stdio.h&gt; /* including standard library */
//#include &lt;windows.h&gt; /* uncomment this for Windows */

#include &lt;math.h&gt; /* including math library */

int main ( void ) 
{

  printf (&quot;4.2 raised to 2 is %f\n&quot;, ldexp(4.2, 2));
  return 0;
}</description>
    </item>
    <item rdf:about="https://code-reference.com/c/math.h/log?rev=1708041936&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2024-02-16T01:05:36+02:00</dc:date>
        <title>log</title>
        <link>https://code-reference.com/c/math.h/log?rev=1708041936&amp;do=diff</link>
        <description>log


    double log(double);


Natural logarithm of a number

C Sourcecode Example

compile in linux with: gcc log.c -o log -lm -Wall

     
#include &lt;stdio.h&gt; /* including standard library */
//#include &lt;windows.h&gt; /* uncomment this for Windows */

#include &lt;math.h&gt; /* including math library */

int main ( void ) 
{
double x;
x = log(1.3);
printf(&quot;The log is %f\n&quot;,x);
return 0;
}</description>
    </item>
    <item rdf:about="https://code-reference.com/c/math.h/log10?rev=1708041935&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2024-02-16T01:05:35+02:00</dc:date>
        <title>log10</title>
        <link>https://code-reference.com/c/math.h/log10?rev=1708041935&amp;do=diff</link>
        <description>double log10(double);


base-10 logarithm of a number

C Sourcecode Example

compile in linux with: gcc log10.c -o log10 -lm -Wall

     
#include &lt;stdio.h&gt; /* including standard library */
//#include &lt;windows.h&gt; /* uncomment this for Windows */

#include &lt;math.h&gt; /* including math library */

int main ( void ) 
{
double x;
x = log10(42000);
printf(&quot;The log10 of 42000 is %f\n&quot;,x);
return 0;
}</description>
    </item>
    <item rdf:about="https://code-reference.com/c/math.h/modf?rev=1708041936&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2024-02-16T01:05:36+02:00</dc:date>
        <title>modf</title>
        <link>https://code-reference.com/c/math.h/modf?rev=1708041936&amp;do=diff</link>
        <description>modf


    double modf(double , double *int);


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

C Sourcecode Example

compile in linux with: gcc modf.c -o modf -lm -Wall


#include &lt;stdio.h&gt; /* including standard library */
//#include &lt;windows.h&gt; /* uncomment this for Windows */

#include &lt;math.h&gt; /* including math library */

int main ( void )
{
  double i, result;
  result=modf(4.2, &amp;i);
  printf (&quot;%lf + %lf = %lf \n&quot;, i, result, 4.2 );
  return 0;
}</description>
    </item>
    <item rdf:about="https://code-reference.com/c/math.h/pow?rev=1708041937&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2024-02-16T01:05:37+02:00</dc:date>
        <title>pow</title>
        <link>https://code-reference.com/c/math.h/pow?rev=1708041937&amp;do=diff</link>
        <description>pow


    double pow(double, double );


pow() returns base raised to the exp power.

C Sourcecode Example

compile in linux with: gcc pow.c -o pow -lm -Wall


#include &lt;stdio.h&gt; /* including standard library */
//#include &lt;windows.h&gt; /* uncomment this for Windows */

#include &lt;math.h&gt; /* including math library */

int main( void )
{
    printf (&quot;4 to the 2th power is: %lf\n &quot;, pow(4, 2));
    return 0;
}</description>
    </item>
    <item rdf:about="https://code-reference.com/c/math.h/sin?rev=1708041935&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2024-02-16T01:05:35+02:00</dc:date>
        <title>sin</title>
        <link>https://code-reference.com/c/math.h/sin?rev=1708041935&amp;do=diff</link>
        <description>sin


     double sin(double);


return the sinus

C Sourcecode Example

compile in linux with: gcc sin.c -o sin -lm -Wall

     
#include &lt;stdio.h&gt; /* including standard library */
//#include &lt;windows.h&gt; /* uncomment this for Windows */

#include &lt;math.h&gt; /* including math library */

int main (void)
{
  double x;
  x = 42.0;
  printf (&quot;sine of %lf° is %lf\n&quot;, x, sin(x*3.1415/80) );
  return 0;
}</description>
    </item>
    <item rdf:about="https://code-reference.com/c/math.h/sinh?rev=1708041936&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2024-02-16T01:05:36+02:00</dc:date>
        <title>sinh</title>
        <link>https://code-reference.com/c/math.h/sinh?rev=1708041936&amp;do=diff</link>
        <description>sinh


     double sinh(double);


return the hyperbolic sinus

C Sourcecode Example

compile in linux with: gcc sinh.c -o sinh -lm -Wall

     
#include &lt;stdio.h&gt; /* including standard library */
//#include &lt;windows.h&gt; /* uncomment this for Windows */

#include &lt;math.h&gt; /* including math library */

int main (void)
{
  double x;
  x = log(4.2);
  printf (&quot;hyperbolic sine of %lf is %lf\n&quot;, x, sinh(x) );
  return 0;
}</description>
    </item>
    <item rdf:about="https://code-reference.com/c/math.h/sqrt?rev=1708041936&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2024-02-16T01:05:36+02:00</dc:date>
        <title>sqrt</title>
        <link>https://code-reference.com/c/math.h/sqrt?rev=1708041936&amp;do=diff</link>
        <description>sqrt


    double sqrt(double);


returns the square root

C Sourcecode Example

compile in linux with: gcc sqrt.c -o sqrt -lm -Wall

     
#include &lt;stdio.h&gt; /* including standard library */
//#include &lt;windows.h&gt; /* uncomment this for Windows */

#include &lt;math.h&gt; /* including math library */

int main ( void )
{
  printf (&quot;square root from 4.2 is %f\n&quot;, sqrt (4.2) );
  return 0;
}</description>
    </item>
    <item rdf:about="https://code-reference.com/c/math.h/tan?rev=1708041937&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2024-02-16T01:05:37+02:00</dc:date>
        <title>tan</title>
        <link>https://code-reference.com/c/math.h/tan?rev=1708041937&amp;do=diff</link>
        <description>tan


    double tan(double);


Returns the tangent of a radian angle x. 

C Sourcecode Example

compile with gcc tan.c -o tan -lm


#include &lt;stdio.h&gt; /* including standard library */
//#include &lt;windows.h&gt; /* uncomment this for Windows */

#include &lt;math.h&gt; /* including math library */

int main( void )
{
    double x;
    x = 42;
    
    printf (&quot;tan of %lf° is %lf\n&quot;, x, tan (x*3.1415/180));
    return 0;
}</description>
    </item>
    <item rdf:about="https://code-reference.com/c/math.h/tanh?rev=1708041936&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2024-02-16T01:05:36+02:00</dc:date>
        <title>tanh</title>
        <link>https://code-reference.com/c/math.h/tanh?rev=1708041936&amp;do=diff</link>
        <description>tanh


    double tanh(double);


Returns hyperbolic tangent of a radian angle x. 

C Sourcecode Example

compile with tanh.c -o tanh -lm


#include &lt;stdio.h&gt; /* including standard library */
//#include &lt;windows.h&gt; /* uncomment this for Windows */

#include &lt;math.h&gt; /* including math library */

int main( void )
{
    double x;
    x = log(42);
    printf (&quot;hyperbolic tangent of 42 is %lf\n&quot;, tanh (x) );
    return 0;
}</description>
    </item>
</rdf:RDF>
