fastrand is smaller, faster, and has no dependencies. Add rng_util helper for f64 range generation since fastrand lacks a built-in equivalent. Migrate all samplers, KDE modules, and fANOVA to use fastrand's concrete Rng type instead of rand's trait-based generics.
6 lines
182 B
Rust
6 lines
182 B
Rust
/// Generate a random `f64` in the range `[low, high)`.
|
|
#[inline]
|
|
pub(crate) fn f64_range(rng: &mut fastrand::Rng, low: f64, high: f64) -> f64 {
|
|
low + rng.f64() * (high - low)
|
|
}
|