diff --git a/src/distribution/bernoulli.rs b/src/distribution/bernoulli.rs index d059fb32..21e3e27f 100644 --- a/src/distribution/bernoulli.rs +++ b/src/distribution/bernoulli.rs @@ -96,7 +96,7 @@ impl ::rand::distributions::Distribution for Bernoulli { #[cfg_attr(docsrs, doc(cfg(feature = "rand")))] impl ::rand::distributions::Distribution for Bernoulli { fn sample(&self, rng: &mut R) -> f64 { - f64::from(rng.sample::(self)) + rng.sample::(self) as u8 as f64 } }