Floorlogkn
Floorlogkn, or floor log base k of n, denotes the greatest integer m such that k^m ≤ n. It is commonly written as floor_log_k(n). The definition requires k > 0 and k ≠ 1 and n > 0; in practice, most discussions assume k > 1. Under these conditions floor_log_k(n) is a nondecreasing function of n when k > 1, and it measures the size of n in base k.
Interpretations and relationships: floor_log_k(n) equals the integer part of the logarithm of n to base k. It
Computing: In floating-point arithmetic, m = floor( ln(n) / ln(k) ). In integer arithmetic without floating point, one can
Examples: floor_log_2(16) = 4; floor_log_10(500) = 2; floor_log_2(1) = 0. Edge cases: for n ≤ 0 the function is undefined