logarithmic function base 4 in c++ code example Example: log base c++ int intlog(double base, double x) { return (int)(log(x) / log(base)); }