def log_floor(n, b):
 p = 1
 k = 0
 while (p <= n):
  p *= b
  k += 1
 return (k - 1)

def log_floor ( n , b ) : p = 1 k = 0 while ( p <= n ) : p *= b k += 1 return ( k - 1 )
the largest integer k such that b^k <= n .