Documentation
¶
Overview ¶
bitops provides various bitwise utilities on uint64s which are not supported by math.bits.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func LeadingOnesMask ¶
LeadingOnesMask returns a bitmask where the first n bits are 1, the others are 0.
If n lies outside the valid range of [0, 64], it will be coerced to the nearest valid value.
func OnesMask ¶
OnesMask returns a bitmask where the first leading and last trailing bits are 1, while the bits between are 0.
If either of leading or trailing lie outside the valid range of [0, 64], they will be coerced to the nearest valid value.
func SingleOneMask ¶
SingleOneMask returns a bitmask where the single bit at position idx is 1, while all others are 0.
If idx is outside the valid range of [0, 63] it is coerced to the nearest valid value.
func TrailingOnesMask ¶
TrailingOnesMask returns a bitmask where the last n bits are 1, the others are 0.
If n lies outside the valid range of [0, 64], it will be coerced to the nearest valid value.
Types ¶
This section is empty.