It's faster to not change the number itself:

```
class Solution:
# @return a boolean
def isPalindrome(self, x):
if x == 0:
return True
if x < 0:
return False
maxpower = int(math.log10(x))
for i in range(maxpower//2+1):
if (x // 10**(maxpower-i)) % 10 != (x % 10**(i+1)) // 10**i:
return False
return True
```