From 97bde9f6236b65aa5a9165554f7ca690b59c2903 Mon Sep 17 00:00:00 2001 From: Otmar Ertl Date: Sun, 11 Mar 2018 09:18:00 +0100 Subject: [PATCH] use all 64 bits of the hash value instead of 63 --- src/hyperloglog.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/hyperloglog.c b/src/hyperloglog.c index c97c4364..9fa8eb43 100644 --- a/src/hyperloglog.c +++ b/src/hyperloglog.c @@ -192,11 +192,12 @@ struct hllhdr { #define HLL_VALID_CACHE(hdr) (((hdr)->card[7] & (1<<7)) == 0) #define HLL_P 14 /* The greater is P, the smaller the error. */ +#define HLL_Q (64-HLL_P) /* The number of bits of the hash value used for + determining the number of leading zeros. */ #define HLL_REGISTERS (1<>= HLL_P; /* Remove bits used to address the register. */ + hash |= ((uint64_t)1<