I have a custom Arbitrary impl for a struct which is made up of four floats. Is there a reason Gen doesn't expose any methods for directly creating float values? I'd be happy to implement this if you'd be willing to add this.
impl Arbitrary for Q {
fn arbitrary<G: Gen>(g: &mut G) -> Self {
Q {
q1: g.next_u32() as f32 / core::u32::MAX as f32 * 2. - 1.,
q2: g.next_u32() as f32 / core::u32::MAX as f32 * 2. - 1.,
q3: g.next_u32() as f32 / core::u32::MAX as f32 * 2. - 1.,
q4: g.next_u32() as f32 / core::u32::MAX as f32 * 2. - 1.,
}
}
}
I have a custom
Arbitrary
impl for a struct which is made up of four floats. Is there a reasonGen
doesn't expose any methods for directly creating float values? I'd be happy to implement this if you'd be willing to add this.