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

support/arbitrary: We should use rand in tests, not arbitrary. #197

Open
github-actions bot opened this issue Oct 28, 2022 · 0 comments
Open

support/arbitrary: We should use rand in tests, not arbitrary. #197

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

Comments

@github-actions
Copy link

On 2022-10-28 @recmo wrote in 49f6271 “Merge pull request #195 from recmo/pow2”:

We should use rand in tests, not arbitrary.

// TODO: Instead of uniform random sampling, we should use a distribution that
// exercises different scales more. Something like sum(±2ⁱ for random i). The
// reduction step can then remove terms or make them smaller.

// TODO: We should use `rand` in tests, not `arbitrary`.

impl<'a, const BITS: usize, const LIMBS: usize> Arbitrary<'a> for Uint<BITS, LIMBS> {
    fn arbitrary(u: &mut Unstructured<'a>) -> Result<Self> {
        let mut limbs = [0; LIMBS];
        if let Some((last, rest)) = limbs.split_last_mut() {

From src/support/arbitrary.rs:11

@github-actions github-actions bot added to do To be done tracker Issue tracked by bot labels Oct 28, 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