diff --git a/README.md b/README.md index 3e93e74..3d77eb5 100644 --- a/README.md +++ b/README.md @@ -2,15 +2,22 @@ Package bitset implements bitsets. It provides methods for making a BitSet of an arbitrary upper limit, setting and testing bit locations, and clearing -bit locations as well as the entire set. +bit locations as well as the entire set, counting the number +of bits. + +It also supports set intersection, union, difference and +symmetric difference, cloning, equality testing, and subsetting. Example use: - - b := bitset.New(64000) - b.SetBit(1000) - if b.Bit(1000) { - b.ClearBit(1000) - } + + import "bitset" + b := bitset.New(64000) + b.SetBit(1000) + b.SetBit(999) + if b.Bit(1000) { + b.ClearBit(1000) + } + b.Clear() Discussion at: [golang-nuts Google Group](https://groups.google.com/d/topic/golang-nuts/7n1VkRTlBf4/discussion) diff --git a/bitset.go b/bitset.go index a2a206d..dcecbce 100644 --- a/bitset.go +++ b/bitset.go @@ -7,10 +7,15 @@ It provides methods for making a BitSet of an arbitrary upper limit, setting and testing bit locations, and clearing - bit locations as well as the entire set. + bit locations as well as the entire set, counting the number + of bits. + + It also supports set intersection, union, difference and + symmetric difference, cloning, equality testing, and subsetting. Example use: - + + import "bitset" b := bitset.New(64000) b.SetBit(1000) b.SetBit(999)