Skip to content

Instantly share code, notes, and snippets.

@dbolkensteyn
Created June 24, 2021 15:26
Show Gist options
  • Save dbolkensteyn/53f687c8e1f2dc70b8c49f2b5d06c9d3 to your computer and use it in GitHub Desktop.
Save dbolkensteyn/53f687c8e1f2dc70b8c49f2b5d06c9d3 to your computer and use it in GitHub Desktop.
Potential issue with Maximum() on sroar
package main
import (
"fmt"
"github.com/RoaringBitmap/roaring"
"github.com/dgraph-io/sroar"
)
func main() {
b := sroar.NewBitmap()
b.Set(1)
b.Set(100)
b.Set(100000)
fmt.Println(b.GetCardinality(), b.Minimum(), b.Maximum()) // 3 1 100
b2 := roaring.NewBitmap()
b2.Add(1)
b2.Add(100)
b2.Add(100000)
fmt.Println(b2.GetCardinality(), b2.Minimum(), b2.Maximum()) // 3 1 100000
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment