Welcome to little lamb

Code » test-msb » next » tree

[next] / 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);
}