-
Notifications
You must be signed in to change notification settings - Fork 0
prevPow
Subhajit Sahu edited this page Aug 9, 2022
·
2 revisions
Find largest power-of-n less than or equal to given number.
function prevPow(x, n)
// x: a number
// n: base
const xnumber = require('extra-number');
xnumber.prevPow(32, 2);
// → 32
xnumber.prevPow(35, 2);
// → 32
xnumber.prevPow(35, 3);
// → 27