pub fn bernoulli_stream<R: Rng + ?Sized>( prob: f64, length: usize, rng: &mut R, ) -> Vec<u8> ⓘ
Generate an unpacked Bernoulli bitstream from a probability.
Values are clamped into [0, 1] before sampling.
[0, 1]