Philip Guenther wrote in
 <fab9d5b0-35b5-cc68-51b-2528664...@gmail.com>:
 |On Sun, 15 May 2022, Steffen Nurpmeso wrote:
 |> Stuart Henderson wrote in
 |...
 |>|what's the perceived problem you're wanting to solve? and does that
 |>|problem actually exist in the first place?
 |> 
 |> The problem is that if have a low upper bound then modulo will "remove a 
 |> lot of randomization".  For example if you have a program which 
 |> generates Lotto numbers (1..49), then using _uniform() as it is will 
 |> generate many duplicates.
 |
 |Wut.  The *WHOLE POINT* of arc4random_uniform() is that it has uniform 
 |distribution.  Says right so in the manpage.  If an implementation of that 
 |API fails to do that, it's a broken implementation.

I always admired its source code comments and have been left
stunning more than just once.

--steffen
|
|Der Kragenbaer,                The moon bear,
|der holt sich munter           he cheerfully and one by one
|einen nach dem anderen runter  wa.ks himself off
|(By Robert Gernhardt)

Reply via email to