               --i;
                    }
                }
                if (d > 0) m = true;
                if (m) r += int2char(d);
            }
        }
        return m ? r : "0";
    }

// (public) -this
    function bnNegate() {
        var r = nbi();
        BigInteger.ZERO.subTo(this, r);
        return r;
    }

// (public) |this|
    function bnAbs() {
        return (this.s < 0) ? this.negate() : this;
    }

// (public) return + if this > a, - if this < a, 0 if equal
    function bnCompare