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

algorithms/div/small: Rewrite in a way that avoids bounds-checks without unsafe. #179

Open
github-actions bot opened this issue Oct 24, 2022 · 0 comments
Assignees
Labels
to do To be done tracker Issue tracked by bot

Comments

@github-actions
Copy link

On 2022-10-24 @recmo wrote in fb3aa20 “Merge pull request #172 from recmo/div2”:

Rewrite in a way that avoids bounds-checks without unsafe.

/// [`div_nx2_normalized`] but does the shifting of the numerator inline.
///
/// # Panics
///
/// May panics if the above requirements are not met.
// TODO: Rewrite in a way that avoids bounds-checks without unsafe.
#[inline(always)]
pub fn div_nx2(limbs: &mut [u64], divisor: u128) -> u128 {
    debug_assert!(divisor >= 1 << 64);
    debug_assert!(!limbs.is_empty());
    debug_assert!(*limbs.last().unwrap() != 0);

From src/algorithms/div/small.rs:118

@github-actions github-actions bot added to do To be done tracker Issue tracked by bot labels Oct 24, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
to do To be done tracker Issue tracked by bot
Projects
None yet
Development

No branches or pull requests

1 participant