Each time, comparing numerical value of the highest and lowest.

```
class Solution
{
public:
bool isPalindrome(int x)
{
if (x < 0)
{
return false;
}
int bits = int(std::log10(double(x))), pow10 = 0;
for (int i = 0; i <= bits; i += 2)
{
pow10 = int(std::pow(double(10), bits - i));
if (x / pow10 != x % 10)
{
return false;
}
x = x % pow10 / 10;
}
return true;
}
};
```