We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
Find smallest power-of-n greater than or equal to given number.
Similar: isPow, prevPow, nextPow.
function nextPow(x, n) // x: a number // n: base
const xmath = require('extra-math'); xmath.nextPow(29, 2); // → 32 xmath.nextPow(29, 4); // → 64 xmath.nextPow(29, 3); // → 81