Determine if a number is 2 to the power of n1
2
3boolean IsPowerOfTwo(ulong x) {
return (x != 0) && ((x & (x - 1)) == 0);
}
Determine if a number is 2 to the power of n1
2
3boolean IsPowerOfTwo(ulong x) {
return (x != 0) && ((x & (x - 1)) == 0);
}