Calculation of floored logarithm