Commit e3234116 authored by antirez's avatar antirez
Browse files

HyperLogLog: redefine constants using "P".

parent e73839e7
...@@ -51,8 +51,9 @@ ...@@ -51,8 +51,9 @@
* analysis of a near-optimal cardinality estimation algorithm. * analysis of a near-optimal cardinality estimation algorithm.
*/ */
#define REDIS_HLL_REGISTERS 16384 #define REDIS_HLL_P 14 /* The greater is P, the smaller the error. */
#define REDIS_HLL_BITS 6 #define REDIS_HLL_REGISTERS (1<<REDIS_HLL_P) /* With P=14, 16384 registers. */
#define REDIS_HLL_BITS 6 /* Enough to count up to 63 leading zeroes. */
#define REDIS_HLL_REGISTER_MAX ((1<<REDIS_HLL_BITS)-1) #define REDIS_HLL_REGISTER_MAX ((1<<REDIS_HLL_BITS)-1)
#define REDIS_HLL_SIZE ((REDIS_HLL_REGISTERS*REDIS_HLL_BITS+7)/8) #define REDIS_HLL_SIZE ((REDIS_HLL_REGISTERS*REDIS_HLL_BITS+7)/8)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment