public int reverseInteger(int x) {
		int result = 0;
		boolean isNeg = (x < 0) ? true : false;
		x = Math.abs(x);
		
		while (x != 0) {
			result = result * 10 + x % 10;
			x = x / 10;
		}
		
		if (result < 0) return -1;  // overflow
		return isNeg ? -result : result;
	}