```
class Solution {
public:
uint32_t reverseBits(uint32_t n) {
int result = 0;
int temp;
int residual = n;
for(int i=0;i<32;i++){
temp = residual%2;
result += temp*pow(2, 31-i);
residual = residual/2;
}
return result;
}
};
```

The input 1 will generate an output number with all 1s in each bit. What's wrong?