HyperLogLog: redefine constants using "P".

This commit is contained in:
antirez 2014-03-28 14:09:28 +01:00
parent e73839e7d5
commit e3234116ad

View File

@ -51,8 +51,9 @@
* analysis of a near-optimal cardinality estimation algorithm.
*/
#define REDIS_HLL_REGISTERS 16384
#define REDIS_HLL_BITS 6
#define REDIS_HLL_P 14 /* The greater is P, the smaller the error. */
#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_SIZE ((REDIS_HLL_REGISTERS*REDIS_HLL_BITS+7)/8)