Skip to main content

round_seeded

Function round_seeded 

Source
pub fn round_seeded(x: f64, seed: u64) -> u32
Expand description

x rounded to an integer at random, unbiased: ⌊x⌋ + 1 with probability frac(x), drawn from seed. An integer x is returned as is without a draw, so a lesson without regrets samples as before.