bignumber.js icon indicating copy to clipboard operation
bignumber.js copied to clipboard

Add signum

Open Azmisov opened this issue 3 years ago • 0 comments

Would be nice to add this:

// returns +/-1 giving the number's sign, except when value is zero, in which +/-0 is returned
P.signum = function () {
    return !!this.c && this.c[0] == 0 ? this.s*0 : this.s;
};

(May be a better way to just return the signed zero value)

Azmisov avatar Feb 16 '22 23:02 Azmisov