eddys_snippets/powerof2.c
2020-10-13 00:01:41 +03:00

4 lines
77 B
C

int IsPowerOfTwo(uint64_t x){
return (x != 0) && ((x & (x - 1)) == 0);
}