Palindrome Number

It beats 91%....

class Solution {  
public:  
    bool isPalindrome(int x) {
        if(x < 0) {
            return false;
        }

        int base = 1;
        int tmp = x;
        while(tmp /= 10) {
            base *= 10;
        }

        while(x) {
            if(x / base !=  x % 10) {
                return false;
            }
            x = x % base;
            x /= 10;
            base /= 100;
        }

        return true;
    }
};