PyObject __div__(final PyObject o, PyMultiarray result) {
        PyMultiarray a, b = PyMultiarray.asarray(o);
        final char type = PyMultiarray.commonType(this._typecode, b._typecode);
        a = this.astype(type);
        b = b.astype(type);
        a = PyMultiarray.stretchAxes(a, b);
        b = PyMultiarray.stretchAxes(b, this);
        if (result == null) {
            result = PyMultiarray.getResultArray(a, b, '\0');
        } else {
            PyMultiarray.checkResultArray(result, a, b);
        }
        try {
            if (result.dimensions.length == 0) {
                result.__setitem__(
                        Py.Ellipsis,
                        a.__div__(PyMultiarray.stretchAxes(b)).__getitem__(0));
            } else {
                switch (type) {
                case '1':
                    PyMultiarray.divByte(
                            a.start,
                            a,
                            b.start,
                            b,
                            result.start,
                            result,
                            0);
                    break;
                case 's':
                    PyMultiarray.divShort(
                            a.start,
                            a,
                            b.start,
                            b,
                            result.start,
                            result,
                            0);
                    break;
                case 'i':
                    PyMultiarray.divInt(
                            a.start,
                            a,
                            b.start,
                            b,
                            result.start,
                            result,
                            0);
                    break;
                case 'l':
                    PyMultiarray.divLong(
                            a.start,
                            a,
                            b.start,
                            b,
                            result.start,
                            result,
                            0);
                    break;
                case 'f':
                    PyMultiarray.divFloat(
                            a.start,
                            a,
                            b.start,
                            b,
                            result.start,
                            result,
                            0);
                    break;
                case 'd':
                    PyMultiarray.divDouble(
                            a.start,
                            a,
                            b.start,
                            b,
                            result.start,
                            result,
                            0);
                    break;
                case 'O':
                    PyMultiarray.divObject(
                            a.start,
                            a,
                            b.start,
                            b,
                            result.start,
                            result,
                            0);
                    break;
                case 'F':
                    PyMultiarray.divComplexFloat(
                            a.start,
                            a,
                            b.start,
                            b,
                            result.start,
                            result,
                            0);
                    break;
                case 'D':
                    PyMultiarray.divComplexDouble(
                            a.start,
                            a,
                            b.start,
                            b,
                            result.start,
                            result,
                            0);
                    break;
                default:
                    throw Py.ValueError("typecode must be in [1silfFdDO]");
                }
            }
        } catch (final java.lang.ArithmeticException ex) {
            if (ex.getMessage().equals("/ by zero")) { throw Py
                    .ZeroDivisionError("divide by zero"); }
            throw ex;
        }
        return PyMultiarray.returnValue(result);
    }