log2 function

dynamic log2(
  1. dynamic v
)

Implementation

function log2(v) {
    return Math.log(v) / Math.log(2) | 0;
}