A^(pow(2,32)-1) : Can anyone explain to me why is this going wrong?


#1

Idea: Xor with the number having all 32 bits set

code:
unsigned int Solution::reverse(unsigned int A) {
if(A==0) return 0;
unsigned int max = 1LL*pow(2, 32) - 1;
return max^A;
}