We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Find smallest power-of-2 greater than or equal to given bigint.
Similar: nextPow2, nextPow10. Similar: isPow2, prevPow2, nextPow2.
function nextPow2(x) // x: a bigint
const xbigint = require('extra-bigint'); xbigint.nextPow2(32n); // → 32n xbigint.nextPow2(1023n); // → 1024n