log function in c++ code example
Example 1: log base c++
int intlog(double base, double x) {
return (int)(log(x) / log(base));
}
Example 2: log base e synthax c++
#include <math.h> /* log */
double param, result;
param = 10;
result = log (param);
printf ("log(%f) = %f\n", param, result );