C examples for math.h:log
function
<cmath> <ctgmath> <math.h>
Returns the natural logarithm of x.
The natural logarithm is the base-e logarithm: the inverse of the natural exponential function exp.
long double logl (long double x); long double log (long double x); double log (double x); float logf(float x); float log (float x); double log (T x);
Parameter | Description |
---|---|
x | Value whose logarithm is calculated. If the argument is negative, a domain error occurs. |
Natural logarithm of x.
#include <stdio.h> #include <math.h> /* log */ int main ()/*from w ww . ja v a 2 s . c o m*/ { double param = 15.5; double result = log (param); printf ("log(%f) = %f\n", param, result ); return 0; }