def test_large_range_correction(self): hll = HyperLogLog(16) for i in range(hll.size() - 1): hll.set_register(i, 16) c = hll.cardinality() correction = 7916284520 <= c and c <= 7916284521 self.assertTrue(correction)
def test_k_param_determines_the_number_of_registers(self): hll = HyperLogLog(5) self.assertEqual(len(hll.registers()), 32) self.assertEqual(hll.size(), 32)