throw new ArithmeticException("Divide by zero");
int[] c;  int shift = bitLength(0, x) - bitLength(0, y);  if (shift > 1) { c = shiftLeft(y, shift - 1); count = shiftLeft(ONE.magnitude, shift - 1); if (shift % 32 == 0) {  int countSpecial[] = new int[shift / 32 + 1]; System.arraycopy(count, 0, countSpecial, 1, countSpecial.length - 1); countSpecial[0] = 0; count = countSpecial; } } else { c = new int[x.length]; count = new int[1];  System.arraycopy(y, 0, c, c.length - y.length, y.length); count[0] = 1; }  int[] iCount = new int[count.length];  subtract(0, x, 0, c); System.arraycopy(count, 0, iCount, 0, count.length);  int xStart = 0; int cStart = 0; int iCountStart = 0;  for (; ; ) { int cmp = compareTo(xStart, x, cStart, c);  while (cmp >= 0) { subtract(xStart, x, cStart, c); add(count, iCount); cmp = compareTo(xStart, x, cStart, c); }  xyCmp = compareTo(xStart, x, 0, y);  if (xyCmp > 0) { if (x[xStart] == 0) { xStart++; }  shift = bitLength(cStart, c) - bitLength(xStart, x);  if (shift == 0) { c = shiftRightOne(cStart, c); iCount = shiftRightOne(iCountStart, iCount); } else { c = shiftRight(cStart, c, shift); iCount = shiftRight(iCountStart, iCount, shift); }  if (c[cStart] == 0) { cStart++; }  if (iCount[iCountStart] == 0) { iCountStart++; } } else if (xyCmp == 0) { add(count, ONE.magnitude); for (int i = xStart; i != x.length; i++) { x[i] = 0; } break; } else { break; } } } else if (xyCmp == 0) { count = new int[1];  count[0] = 1; } else { count = new int[1];  count[0] = 0;
    public BigInteger divide(BigInteger val) throws ArithmeticException    {        if (val.sign == 0)        {            throw new ArithmeticException("Divide by zero");        }        if (sign == 0)        {            return BigInteger.ZERO;        }        if (val.compareTo(BigInteger.ONE) == 0)        {            return this;        }        int[] mag = new int[this.magnitude.length];        System.arraycopy(this.magnitude, 0, mag, 0, mag.length);        return new BigInteger(this.sign * val.sign, divide(mag, val.magnitude));    }