Welcome to little lamb

Code » test-msb » master » tree

[master] / src / m10.c

1
2
3
4
5
6
7
8
9
#include <stdint.h>

typedef uint64_t u64;

int msb(u64 v)
{
    if (!v) return 0;
    return 64 - __builtin_clzll(v);
}