Skip to content

Glossary: Algorithms Beyond the Basics in Java

power of two

Also written: powers of two

A number like 1, 2, 4, 8 that has exactly one 1 bit. For positive n, `(n & (n - 1)) == 0` is true only for powers of two.

Where the book teaches it

Related terms

binarybit operators