The solution is:

```
bool isPowerOfTwo(int n) {
return log(n)/log(2)==(int)(log(n)/log(2));
}
```

It passes all other cases except 2^29 this one. It is not the result of overflow, since it generates correct answer on 2^30. Is it something like inline type transformation?

It is quite weired!