jaideeppyne opened a new pull request, #285:
URL: https://github.com/apache/datasketches-rust/pull/285

   Unsigned Count-Min counters lose precision when converted to `f64` for 
scaling. For example, a weight of 9,007,199,254,740,993 becomes 
9,007,199,254,740,992 after `decay(1.0)`, and `decay(0.5)` can disagree with 
`halve()` near `u64::MAX`.
   
   Multiply the integer counter by the float's exact binary significand using 
`u128`, then shift and truncate. This preserves the full counter range for 
decay and unsigned error-bound scaling, without dependencies or serialization 
changes.
   
   Regression coverage exercises identity, half, and three-quarter factors 
above 2^53 and near `u64::MAX`, plus subnormal factors and serialization round 
trips. The regression fails on the original implementation.
   
   Validation: `cargo x prepare-testdata`, `cargo x check`, `cargo x test`, and 
`cargo x lint` all pass.
   


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