etseidl commented on pull request #266:
URL: https://github.com/apache/datasketches-cpp/pull/266#issuecomment-1063715809
I compiled the following with c++ -g -std=c++17 -I./include
-I../common/include test.cc
```
#include <hll.hpp>
using datasketches::hll_sketch;
int
main()
{
hll_sketch sk(10);
// add enough values to force CouponHashList
for (int i=0; i < 10; i++) sk.update(i);
auto bytes = sk.serialize_updatable();
hll_sketch sk2 = hll_sketch::deserialize(bytes.data(), bytes.size());
std::cout << "sk " << sk.get_estimate() << std::endl;
std::cout << "sk2 " << sk2.get_estimate() << std::endl;
// add more until hll kicks in
for (int i=11; i < 99; i++) {
sk.update(i);
sk2.update(i);
}
std::cout << "sk " << sk.get_estimate() << std::endl;
std::cout << "sk2 " << sk2.get_estimate() << std::endl;
return 0;
}
```
without my patch, the output is:
```
% ./a.out
sk 10
sk2 10
sk 98.0612
sk2 98.0558
```
with my patch:
```
% ./a.out
sk 10
sk2 10
sk 98.0612
sk2 98.0612
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]