proost commented on code in PR #552:
URL: https://github.com/apache/datasketches-cpp/pull/552#discussion_r4386338465


##########
req/include/req_sketch_impl.hpp:
##########
@@ -30,7 +30,7 @@ template<typename T, typename C, typename A>
 req_sketch<T, C, A>::req_sketch(uint16_t k, bool hra, const C& comparator, 
const A& allocator):
 comparator_(comparator),
 allocator_(allocator),
-k_(std::max<uint8_t>(static_cast<int>(k) & -2, 
static_cast<int>(req_constants::MIN_K))), //rounds down one if odd
+k_(std::max<uint16_t>(static_cast<int>(k) & -2, 
static_cast<int>(req_constants::MIN_K))), //rounds down one if odd

Review Comment:
   Thanks for fixing this. But For the cross language compatibility, can you 
add validation logic in the constructor, that reject k is bigger than 1024.



-- 
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]

Reply via email to