for example, if we want to calc (17/2)

ret = 0;

17-2 ,ret+=1; left=15

15-4 ,ret+=2; left=11

11-8 ,ret+=4; left=3

3-2 ,ret+=1; left=1

ret=8;

```
class Solution:
# @return an integer
def divide(self, dividend, divisor):
isMinus= ((dividend<0 and divisor >0) or (dividend>0 and divisor <0));
ret=0;
dividend,divisor=abs(dividend),abs(divisor);
c,sub=1,divisor;
while(dividend >= divisor):
if(dividend>=sub):
dividend-=sub;
ret+=c;
sub=(sub<<1);
c=(c<<1);
else:
sub=(sub>>1);
c=(c>>1);
if(isMinus):
ret=-ret;
return min(max(-2147483648,ret),2147483647);
```