Answers for "most significant bit using clz"

0

most significant bit using clz

int clz(int N) {
    return N ? 32 - __builtin_clz(N) : -inf;
}
int clz(unsigned long long N) {
    return N ? 64 - __builtin_clzll(N) : -inf;
}
Posted by: Guest on May-10-2020

Browse Popular Code Answers by Language