Skip to content

Commit

Permalink
replace max_value method by associated constant
Browse files Browse the repository at this point in the history
  • Loading branch information
bsteinb committed Jul 15, 2024
1 parent 98ea7c1 commit 61342c8
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/sum/ifastsum.rs
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ where

// Step 3(2)(b)(i)
// The following addition is guaranteed not to overflow, because:
debug_assert!(count < usize::max_value());
debug_assert!(count < usize::MAX);
// and thus:
debug_assert!(count.checked_add(1).is_some());
count += 1;
Expand All @@ -91,7 +91,7 @@ where
*xs.get_unchecked_mut(count) = st;
}
// The following addition is guaranteed not to overflow, because:
debug_assert!(count < usize::max_value());
debug_assert!(count < usize::MAX);
// and thus:
debug_assert!(count.checked_add(1).is_some());
*n = count + 1;
Expand Down
2 changes: 1 addition & 1 deletion src/sum/onlineexactsum.rs
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ where
// this point):
debug_assert!(self.i < F::base_pow_significand_digits_half());
// and (for `f32` and `f64`) we have:
debug_assert!(F::base_pow_significand_digits_half() < usize::max_value());
debug_assert!(F::base_pow_significand_digits_half() < usize::MAX);
// thus we can assume:
debug_assert!(self.i.checked_add(1).is_some());
self.i += 1;
Expand Down

0 comments on commit 61342c8

Please sign in to comment.