Hello,
I just noticed that there isn’t a library function to calculate log 2 of an integer; getting to this seems cumbersome via recursive loops (e.g. shift left 1 until zero), or some lookup (hash), best, if it were built in like the shift operator.
Here are some tricks to calculate it fast in C:
Dan