-
Notifications
You must be signed in to change notification settings - Fork 0
nextPow
Subhajit Sahu edited this page Aug 8, 2022
·
1 revision
Find smallest power-of-n greater than or equal to given number.
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