uint
uint copied to clipboard
`support/arbitrary`: We should use `rand` in tests, not `arbitrary`.
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() {