Skip to content

Commit

Permalink
refactor: replace unstable div_ceil
Browse files Browse the repository at this point in the history
  • Loading branch information
grjte committed Jul 15, 2024
1 parent 1c4faaa commit 8f819a0
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
1 change: 0 additions & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,6 @@ FpMul:
*/
#![feature(int_roundings)]
mod check_carry_to_zero;
mod lookup_range_check;
mod mul_cfgs;
Expand Down
3 changes: 2 additions & 1 deletion src/lookup_range_check.rs
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,8 @@ impl<F: PrimeFieldBits, const K: usize> LookupRangeCheckConfig<F, { K }> {
) -> Result<RunningSum<F>, Error> {
// `num_bits` must fit into a single field element.
assert!(num_bits <= F::CAPACITY as usize);
let num_words = num_bits.div_ceil(K);
// use (a + b - 1) / b to get the ceiling of a/b instead of unstable `div_ceil`
let num_words = (num_bits + K - 1) / K;

// Chunk the first num_bits bits into K-bit words.
let words = {
Expand Down

0 comments on commit 8f819a0

Please sign in to comment.