Loading...
Select Version
&pagelevel(4)&pagelevel
Definition | #include <math.h> double log(double x); These functions calculate the natural logarithm of the positive floating-point number x to the base | |
Return val. | ln(x) | for positive x. |
| depending on the function type, | |
Example | #include <math.h>
#include <stdio.h>
int main(void)
{
double x;
printf("Example of log(x): Please enter x\n");
if(scanf("%lf", &x) == 1)
printf("x = %g log(x) = %g\n", x, log(x));
return 0;
}
| |
See also | log2, log10, exp, exp2 | |