tisonkun commented on issue #717:
URL: 
https://github.com/apache/datasketches-java/issues/717#issuecomment-3772977351

   For reference, I'm writing the following check in the Rust impl:
   
   ```rust
       pub fn new(lg_size: u8, num_valid_bits: u8) -> Self {
           assert!(
               (2..=26).contains(&lg_size),
               "lg_size must be in [2, 26], got {lg_size}"
           );
           assert!(
               ((lg_size + 1)..=32).contains(&num_valid_bits),
               "num_valid_bits must be in [lg_size + 1, 32], got 
{num_valid_bits} where lg_size = {lg_size}"
           );
           Self {
               lg_size,
               num_valid_bits,
               num_items: 0,
               slots: vec![u32::MAX; 1 << lg_size],
           }
       }
   ```


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