MCPcopy Create free account
hub / github.com/bits-and-blooms/bitset / ExampleBitSet_Complement

Function ExampleBitSet_Complement

example_test.go:163–167  ·  view source on GitHub ↗

ExampleBitSet_Complement flips every bit within the set's length.

()

Source from the content-addressed store, hash-verified

161
162// ExampleBitSet_Complement flips every bit within the set's length.
163func ExampleBitSet_Complement() {
164 b := New(8).Set(1).Set(3)
165 fmt.Println(b.Complement().String())
166 // Output: {0,2,4,5,6,7}
167}
168
169// ExampleBitSet_InPlaceUnion mutates the receiver instead of allocating a new
170// set. The In-Place variants (and the *Cardinality helpers) avoid allocation in

Callers

nothing calls this directly

Calls 4

NewFunction · 0.85
SetMethod · 0.80
StringMethod · 0.80
ComplementMethod · 0.80

Tested by

no test coverage detected