Skip to content

Glossary: Algorithms Beyond the Basics in Go

bits.OnesCount

Also written: math/bits, OnesCount

A function from Go's `math/bits` package that counts the 1 bits in an unsigned number. Use it to count how many options an order has.

Where the book teaches it

Related terms

BitmaskBinaryUnsigned integer (uint)