function
<cmath> <ctgmath>
logdouble log ( double x); float logf ( float x);long double logl (long double x);
double log ( double x); float log ( float x);long double log (long double x);
double log (double x); float log (float x);long double log (long double x); double log (T x); // additional overloads for integral types
Compute natural logarithm
Returns the natural logarithm of x.The natural logarithm is the base-e logarithm: the inverse of the natural exponential function (exp). For common (base-10) logarithms, see log10.
Header
<tgmath.h>provides a type-generic macro version of this function.
If a
domain erroroccurs, the global variable
errnois set to
EDOM.
If a
pole erroroccurs, the global variable
errnois set
ERANGE.
1
2
3
4
5
6
7
8
9
10
11
12
/* log example */
#include <stdio.h> /* printf */
#include <math.h> /* log */
int main ()
{
double param, result;
param = 5.5;
result = log (param);
printf ("log(%f) = %f\n", param, result );
return 0;
}
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4