#include <limits.h>
#include <math.h>
#include <stdio.h>
int main(void) {
const auto n = 13UL;
const auto Index = n > 0UL ? (unsigned long)log2(n) : ULONG_MAX;
printf("MSB is: %u\n", Index
); // Prints 3 (zero offset) }
I2luY2x1ZGUgPGxpbWl0cy5oPgojaW5jbHVkZSA8bWF0aC5oPgojaW5jbHVkZSA8c3RkaW8uaD4KCmludCBtYWluKHZvaWQpIHsKICAgIGNvbnN0IGF1dG8gbiA9IDEzVUw7CiAgICBjb25zdCBhdXRvIEluZGV4ID0gbiA+IDBVTCA/ICh1bnNpZ25lZCBsb25nKWxvZzIobikgOiBVTE9OR19NQVg7CgogICAgcHJpbnRmKCJNU0IgaXM6ICV1XG4iLCBJbmRleCk7IC8vIFByaW50cyAzICh6ZXJvIG9mZnNldCkKfQo=