```
class Solution {
public:
int divide(int dividend, int divisor) {
int ret = 0;
int sign = 1;
if (dividend<0){sign = -sign;}
if (divisor<0){sign = -sign;}
unsigned long long tmp = abs((long long)dividend);
unsigned long long tmp2 = abs((long long)divisor);
while (tmp>=tmp2) {
*****//unsigned long long d=tmp2;
int d = tmp2;*****
int r=1;
while (tmp-d>=d){
d+=d;
r+=r;
}
tmp=tmp-d;
ret+=r;
}
return ret*sign;
}
};
```

if I use "int d=tmp2", the test case will fail on (-2147483648, 1). But if I change back to "unsigned long long d=tmp2;", it will pass. I cannot find out where the problem is.