Commit graph

4 commits

Author SHA1 Message Date
Veikka Tuominen
e6be6d9768 std.rand: make weightedIndex proportions param a const slice
The function does not mutate the proportions and the signature should reflect that.
2022-08-30 13:02:17 +03:00
Justin Whear
5bb8c03697
std.random: add weightedIndex function
`weightedIndex` picks from a selection of weighted indices.
2022-08-28 14:19:51 +03:00
Erik Arvstedt
1d5ea10bee std.rand: fixup 'improve random float generation'
- Test: Fix bucket counting. Previously, the first hit was not counted.
  This off-by-one error slightly increased the mean of `*_total_variance`,
  which decreased the acceptance rate for a particular random seed
  from 95% to 92.6%. (Irrelevant for test failure because the seed is fixed.)
- Improve comments
2022-05-12 15:39:19 +02:00
Andrew Kelley
7bedeb9659 std.rand: move tests to a separate test file 2022-05-10 19:02:03 -07:00