 var self = this;
        var pm = m.abs();
        if (pm.t <= 0) return;
        var pt = self.abs();
        if (pt.t < pm.t) {
            if (q != null) q.fromInt(0);
            if (r != null) self.copyTo(r);
            return;
        }
        if (r == null) r = nbi();
        var y = nbi(), ts = self.s, ms = m.s;
        var nsh = self.DB - nbits(pm[pm.t - 1]);  // normalize modulus
        if (nsh > 0) {
            pm.lShiftTo(nsh, y);
            pt.lShiftTo(nsh, r);
        }
        else {
  