I know the other solution using bit shift. Please help me understand the problem here.

```
public class Solution {
// you need treat n as an unsigned value
public int reverseBits(int n) {
long sum = 0;
int digit = 31;
while (n > 0) {
if ((n&1) == 1) sum += Math.pow(2, digit);
n >>>= 1;
digit--;
}
return (int)sum;
}
}
```

Err Message:

- Input: 2147483648 (10000000000000000000000000000000)
- Output: 0 (00000000000000000000000000000000)
- Expected: 1 (00000000000000000000000000000001)