#[cfg(feature = "arb")] trait UnstructuredFloatExt { fn float_in_range(&mut self, range: core::ops::RangeInclusive) -> arbitrary::Result; } #[cfg(feature = "arb")] impl UnstructuredFloatExt for arbitrary::Unstructured<'_> { fn float_in_range(&mut self, range: core::ops::RangeInclusive) -> arbitrary::Result { let min = range.start(); let max = range.end(); let steps = u32::MAX; let factor = (max - min) / (steps as f32); let random_int: u32 = self.int_in_range(0..=steps)?; let random = min + factor * (random_int as f32); Ok(random) } }