
Click above to get retro games delivered to your door ever month!
X-Hacker.org- Zortech C++ Language Reference - log
[<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
log
Usage
#include <math.h>
double log(double x);
Description
log returns the natural logarithm of x. The value of x must be > 0.
Example
#include <math.h>
#include <stdio.h>
main(int argc,char **argv)
{
double d,result;
d = atof(argv[1]);
result = log(d);
printf("The log of %.2f is %f\n",d,result);
}
Return Value
The log function returns the logarithm result or domain error if x <
0, range error if x == 0.
See Also: exp log10 pow sqrt
Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson