```
class Solution {
public:
bool isPowerOfThree(int n) {
float log_num = log10(n) / log10(3);
return log_num == int(log_num);
}
};
class Solution {
public:
bool isPowerOfThree(int n) {
return (int(log10(n) / log10(3)) - log10(n) / log10(3) == 0);
}
};
```

Why the second class's function doesnt work??