log2 - nodef/extra-bigint GitHub Wiki
Find the base-2 logarithm of a bigint.
function log2(x)
// x: a bigint
const xbigint = require('extra-bigint');
xbigint.log2(32n);
// → 5n
xbigint.log2(127n);
// → 6n
Find the base-2 logarithm of a bigint.
function log2(x)
// x: a bigint
const xbigint = require('extra-bigint');
xbigint.log2(32n);
// → 5n
xbigint.log2(127n);
// → 6n