I wanted to check if the number is a palindrome the same way you would check if a string is a palindrome, with a left pointer and right pointer that walk toward the middle. The only trick is finding the largest multiple of 10 smaller than x, for which I use the pow, floor, and log10 functions:

```
bool isPalindrome(int x) {
if (x < 0) return false;
int left = pow(10, floor(log10(x)));
int right = 1;
while (right < left) {
if ((x / left - x / right) % 10 != 0) {
return false;
}
right *= 10;
left /= 10;
}
return true;
}
```