-
Notifications
You must be signed in to change notification settings - Fork 0
prevPow2
Subhajit Sahu edited this page Aug 1, 2022
·
9 revisions
Finds previous power-of-2.
prevPow2(x)
// x: an int32
const xinteger = require('extra-integer');
xinteger.prevPow2(63);
// → 32
xinteger.prevPow2(128);
// → 128
xinteger.prevPow2(1);
// → 1