-
Notifications
You must be signed in to change notification settings - Fork 0
isPow2
Subhajit Sahu edited this page Aug 1, 2022
·
17 revisions
Checks if value is a power-of-2.
isPow2(x)
// x: an int32
const xinteger = require('extra-integer');
xinteger.isPow2(1024);
// → true
xinteger.isPow2(63);
// → false
xinteger.isPow2(1);
// → true