Divide Two Integers Not Easy

       long a = Math.abs((long) dividend);
       long b = Math.abs((long) divisor);
       if (b > a) {
           return 0;
       }

       long sum = 0;
       long pow = 0;
       int result = 0;
       while (a >= b) {
           pow = 1;
           sum = b;
           while (sum + sum <= a) {
               sum += sum;
               pow += pow;
           }
           a -= sum;
           result += pow;
       }