Skip to content
Subhajit Sahu edited this page Aug 9, 2022 · 7 revisions

Get the sign of a bigint.

Similar: abs, sign.


function sign(x)
// x: a bigint

const xbigint = require('extra-bigint');


xbigint.sign(-2n);
// → -1n

xbigint.sign(0n);
// → 0n

xbigint.sign(5n);
// → 1n


References

Clone this wiki locally