log2Ceil function

int log2Ceil(
  1. int w
)

Computes the bit width needed to store w addresses.

Implementation

int log2Ceil(int w) => (log(w) / log(2)).ceil();