For calculating Log base 2 values with up to 2 decimal values and not floor of Log base 2 values
My Flawed Solution:
static double logbase2(double x) {// It calculates Log base 2 n
if(x<=1)
return 0;
else
return 1+logbase2(x/2);
}
I want Log value of up to 2 decimal points so please give pointers
When I am trying, I am always getting floor values.