public int divide(int dividend, int divisor) {
		int res = 0;
		boolean isNeg = false;
		if((dividend < 0 && divisor > 0) || (dividend > 0 && divisor < 0)) isNeg = true;
		long dividend1 = Math.abs((long)dividend);
		long divisor1 = Math.abs((long)divisor);

		while(dividend1 >= divisor1){
            long d = divisor1;
            int c = 1;
			for(; dividend1 >= d; c = c << 1, d = d << 1){
				dividend1 -= d;
				res += c;
			}
		}
        return isNeg? -res: res;
	}