log2 - nodef/extra-bigint GitHub Wiki

Find the base-2 logarithm of a bigint.

Similar: log2, log10.

function log2(x)
// x: a bigint
const xbigint = require('extra-bigint');


xbigint.log2(32n);
// → 5n

xbigint.log2(127n);
// → 6n

References