Skip to content

prevPow2

Subhajit Sahu edited this page Jun 7, 2020 · 9 revisions

Gets next power-of-2. [:running:] 📼 [:package:] [:moon:] [:ledger:]

Similar: log2, pow2, isPow2, nextPow2.

integer.nextPow2(x);
// x: an int32
const integer = require('extra-integer');

integer.nextPow2(63);
// 64

integer.nextPow2(128);
// 128

integer.nextPow2(1);
// 1

references

Clone this wiki locally