log2floor

(function from pyomo.core.kernel.piecewise_library.util)

pyomo.core.kernel.piecewise_library.util.log2floor(n)[source]

Computes the exact value of floor(log2(n)) without using floating point calculations. Input argument must be a positive integer.