Convert to double representation, which kinda takes the logarithm. Without precision problems. Then check the bit pattern.

```
bool isPowerOfFour(int num) {
double n = num;
return (*(long*)&n & 0x801FFFFFFFFFFFFF) == 0x10000000000000;
}
```

There's probably a prettier way to use the idea, but I'll leave it at this.