pub fn random_bool(p: f64) -> bool
Return a bool with a probability p of being true.
p
This function is shorthand for rng().random_bool(p).
rng().random_bool(p)
println!("{}", rand::random_bool(1.0 / 3.0));
If p < 0 or p > 1.
p < 0
p > 1