예제 #1
0
    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)
예제 #2
0
파일: test.py 프로젝트: kornev/HyperLogLog
    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)
예제 #3
0
 def test_k_param_determines_the_number_of_registers(self):
     hll = HyperLogLog(5)
     self.assertEqual(len(hll.registers()), 32)
     self.assertEqual(hll.size(), 32)
예제 #4
0
파일: test.py 프로젝트: kornev/HyperLogLog
 def test_k_param_determines_the_number_of_registers(self):
     hll = HyperLogLog(5)
     self.assertEqual(len(hll.registers()), 32)
     self.assertEqual(hll.size(), 32)