Skip to main content

bernoulli_stream

Function bernoulli_stream 

Source
pub fn bernoulli_stream<R: Rng + ?Sized>(
    prob: f64,
    length: usize,
    rng: &mut R,
) -> Vec<u8> 
Expand description

Generate an unpacked Bernoulli bitstream from a probability.

Values are clamped into [0, 1] before sampling.