C examples for math.h:log1p
function
<cmath> <ctgmath> <math.h>
Returns the natural logarithm of one plus x.
long double log1pl (long double x); long double log1p (long double x); double log1p (double x); float log1pf (float x); float log1p (float x); double log1p (T x);
Parameter | Description |
---|---|
x | Value whose logarithm is calculated. If the argument is less than -1, a domain error occurs. |
The natural logarithm of (1+x).
#include <stdio.h> #include <math.h> int main ()//from ww w . jav a 2 s . co m { double param = 1.0; double result = log1p (param); printf ("log1p (%f) = %f.\n", param, result ); return 0; }