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:
Arthur Meyre
2025-11-06 17:36:56 +01:00
committed by IceTDrinker
parent 4f9f4982f6
commit c3c892708a

View File

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