![The next power of 2 and other tricks with logarithms](https://blogs.sas.com/content/iml/files/2014/10/t_pow2.png)
The other day I was doing some computations that caused me to wonder, "What is the smallest power of 2 that is greater than a given number?" The mathematics is straightforward. Given a number n, find the least value of k such that 2k ≥ n or, equivalently, k ≥