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

Get the absolute of a bigint.

Similar: abs, sign.


function abs(x)
// x: a bigint

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


xbigint.abs(-2n);
// → 2n

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

xbigint.abs(5n);
// → 5n


References

Clone this wiki locally