Created
June 24, 2021 15:26
-
-
Save dbolkensteyn/53f687c8e1f2dc70b8c49f2b5d06c9d3 to your computer and use it in GitHub Desktop.
Potential issue with Maximum() on sroar
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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