-
Notifications
You must be signed in to change notification settings - Fork 2
root
Subhajit Sahu edited this page Aug 9, 2022
·
7 revisions
Find the nth root of a bigint.
function root(x, n)
// x: a bigint
// n: nth root (1n)
const xbigint = require('extra-bigint');
xbigint.root(25n, 2n);
// → 5n
xbigint.root(-8n, 3n);
// → -2n
xbigint.root(81n, 4n);
// → 3n
xbigint.root(99n, 4n);
// → 3n