Skip to content
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Readded ‘-‘ to start of approxItems() formula that somehow got removed
  • Loading branch information
Bcpoole committed Feb 9, 2017
commit 9cd716506daaf3508a984713bc8a267e4d1bfcb2
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ public BloomFilter mergeInPlace(BloomFilter other) throws IncompatibleMergeExcep
@Override
public double approxItems() {
double m = bitSize();
return (m / numHashFunctions) * Math.log(1 - (bits.cardinality() / m));
return (-m / numHashFunctions) * Math.log(1 - (bits.cardinality() / m));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • Math is deprecated. Use math.
  • Please add a test when bits is full. This should return Double.Infinity.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Math is deprecated. Use math.

Assume you were thinking of Scala?

}

@Override
Expand Down