RNG
Closed this issue · 2 comments
stychu commented
Hello there,
how does rng.oneIn(x) work exactly? Could some1 describe it?
Mudshovel commented
Hey there,
It's documented here => https://github.com/munificent/piecemeal/blob/master/lib/src/rng.dart
Apart from that, can't help much =)
munificent commented
@Mudshovel is right. More specifically: https://github.com/munificent/piecemeal/blob/master/lib/src/rng.dart#L95
It returns true
1/x of the time. So oneIn(3)
returns true
a third of the time and false otherwise.