Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Cookbook ideas for the rand crate #227
We already have 4 examples:
So it's not obvious we need more. But here's an opportunity to reevaluate the set we've got and brainstorm about it.
referenced this issue
Sep 24, 2017
How about an example of creating a specified-length vector of random numbers out of
edit: I realize a bit late that with the current
Fair points. To be honest rand requires a major rewrite to make it really pleasant to use.
let mut rng = rand::thread_rng(); // mean 2, standard deviation 3: let normal = Normal::new(2.0, 3.0); let v: Vec<_> = (0..10).map(|_| normal.ind_sample(&mut rng)).collect();
I read the 0.5 Changelog and the stuff they added was great, but not really helpful to a wide audience. Most of the changes were to support true randomness required for a security perspective. I'm not sure there's a lot of value to a wide audience for this. @pitdicker did a good job in #391 to update the API. I think the cookbook has a good sample of Rand usage.