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

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

Clone this wiki locally