mirror of
https://github.com/zama-ai/tfhe-rs.git
synced 2026-01-09 22:57:59 -05:00
chore: fix comment confusing comment in decomposer.rs
- function is documented and the comment did not match, the behavior is checked in a test
This commit is contained in:
committed by
IceTDrinker
parent
4f9f4982f6
commit
c3c892708a
@@ -176,7 +176,9 @@ where
|
||||
let mod_mask = Scalar::MAX >> (Scalar::BITS - rep_bit_count);
|
||||
res &= mod_mask;
|
||||
// Control bit about whether we should balance the state
|
||||
// This is equivalent to res > 2^(base_log * l) || (res == 2^(base_log * l) && random == 1)
|
||||
// This is equivalent to:
|
||||
// res > B / 2 || (res == B / 2 && random == 1)
|
||||
// with B = 2^(base_log * l)
|
||||
let need_balance = balanced_rounding_condition_bit_trick(res, rep_bit_count, rounding_bit);
|
||||
// Balance depending on the control bit
|
||||
res.wrapping_sub(need_balance << rep_bit_count)
|
||||
|
||||
Reference in New Issue
Block a user