Skip to content

Glossary: Algorithms Beyond the Basics in Go

Power of two

Also written: powers of two

1, 2, 4, 8…: a number with exactly one 1 bit. `n&(n-1) == 0` spots one, and flags use them so each option has its own bit.

Where the book teaches it

Related terms

FlagBitmask