Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrNotPowerOfTwo = errors.New("size must be a power of two")
ErrNotPowerOfTwo is returned when the size of the bitset is not a power of two.
Functions ¶
This section is empty.
Types ¶
type Bits ¶
type Bits struct {
// contains filtered or unexported fields
}
Bits is a simple bitset implementation, which is a fixed-size array of bits. It supports setting, clearing, and checking the value of a bit at a given position. It also supports counting the number of 1s in the bitset and shifting all bits to the left or right.
func (*Bits) RightShift ¶
RightShift right shifts the entire bitset by n positions.
Click to show internal directories.
Click to hide internal directories.