Java-BloomFilter icon indicating copy to clipboard operation
Java-BloomFilter copied to clipboard

ArithmeticException in case expectedNumberOElements is 0

Open dmironenko opened this issue 9 years ago • 0 comments

I'm getting: java.lang.ArithmeticException: / by zero at com.skjegstad.utils.BloomFilter.contains(BloomFilter.java:345)

after creating filter with expectedNumberOfElements = 0 with constructor: public BloomFilter(double falsePositiveProbability, int expectedNumberOfElements) and check if it contains some element What I'm expecting is either:

  • false when calling contains
  • exception on creation of filter which will tell me that 0 is bad value and I'm awful person that I passed it

dmironenko avatar Apr 21 '15 11:04 dmironenko