Glossary: Algorithms Beyond the Basics in Go
Shift left / shift right
Also written: <<, >>, shift
`a << n` moves bits left, doubling the number n times, and `a >> n` moves them right, halving it. `1 << n` is 2ⁿ.
Glossary: Algorithms Beyond the Basics in Go
Also written: <<, >>, shift
`a << n` moves bits left, doubling the number n times, and `a >> n` moves them right, halving it. `1 << n` is 2ⁿ.