Commits

Bryan O'Sullivan  committed 3fdf1b3

Fix maximum sizing calculation.

  • Participants
  • Parent commits c566073

Comments (0)

Files changed (1)

File Data/BloomFilter/Easy.hs

             minimum [((-k) * cap / log (1 - (errRate ** (1 / k))), k)
                      | k <- [1..100]]
         roundedBits = nextPowerOfTwo (ceiling bits)
-    in if roundedBits <= 0
+    in if roundedBits <= 0 || roundedBits > 0xffffffff
        then Left  "capacity too large to represent"
        else Right (roundedBits, truncate hashes)