-256;
                if (k === 0 && (self.s & 0x80) != (d & 0x80)) ++k;
                if (k > 0 || d != self.s) r[k++] = d;
            }
        }
        return r;
    }

    function bnEquals(a) {
        return(this.compareTo(a) == 0);
    }

    function bnMin(a) {
        return(this.compareTo(a) < 0) ? this : a;
    }

    function bnMax(a) {
        return(this.compareTo(a) > 0) ? this : a;
    }

// (protected) r = this op a (bitwise)
    function bnpBitwiseTo(a, op, r) {
        var self = this