Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

perf: remove unnecessary assertions in div_* #380

Merged
merged 2 commits into from
Jun 15, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions src/div.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ impl<const BITS: usize, const LIMBS: usize> Uint<BITS, LIMBS> {
#[must_use]
#[track_caller]
pub fn div_ceil(self, rhs: Self) -> Self {
assert!(rhs != Self::ZERO, "Division by zero");
let (q, r) = self.div_rem(rhs);
if r.is_zero() {
q
Expand All @@ -51,7 +50,6 @@ impl<const BITS: usize, const LIMBS: usize> Uint<BITS, LIMBS> {
#[must_use]
#[track_caller]
pub fn div_rem(mut self, mut rhs: Self) -> (Self, Self) {
assert!(rhs != Self::ZERO, "Division by zero");
algorithms::div(&mut self.limbs, &mut rhs.limbs);
(self, rhs)
}
Expand Down
Loading