This is an automated email from the ASF dual-hosted git repository. jmalkin pushed a commit to branch lg_size_bugfix in repository https://gitbox.apache.org/repos/asf/incubator-datasketches-cpp.git
commit 8a3020cfdf610efe023c7ebe7472cb037308f93c Author: Jon Malkin <[email protected]> AuthorDate: Fri Jun 21 14:31:03 2019 -0700 restore missing load_factor --- theta/include/theta_sketch.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/theta/include/theta_sketch.hpp b/theta/include/theta_sketch.hpp index 5abc5e9..bd2ec1d 100644 --- a/theta/include/theta_sketch.hpp +++ b/theta/include/theta_sketch.hpp @@ -301,7 +301,7 @@ constexpr uint8_t lg_size_from_count(uint32_t n, double load_factor) { //uint8_t lg = log2(n) + 1; //if (n > (1 << lg) * load_factor) lg++; //return lg; - return log2(n) + (n > (1 << (log2(n) + 1)) ? 2 : 1); + return log2(n) + ((n > (1 << (log2(n) + 1)) * load_factor) ? 2 : 1); } } /* namespace datasketches */ --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
