Re: [PATCH] Add example to rand.3

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



At 2022-12-28T00:33:13+0100, Alejandro Colomar wrote:
> The only problem with arc4random() is the lack of repeatability.  When
> testing a program with random data, you'll need repeatable results.
> For that, rand(3) Just Works.  When you want unpredictable results,
> you just seed it with some really random value, and you're fine.  You
> need to be careful to not introduce bias, but there's nothing better
> in libc.  It would be nice if libc provided a rand_uniform(3) variant
> of rand(3), BTW.

Permit me to counsel against that last proposed name.  In probability
theory "uniform" is already widely and well understood to indicate the
nature of the distribution.  A "uniform" distribution is one in which
each outcome is precisely equally likely.

rand_deterministic() would get the right idea across but is lengthy.

Regards,
Branden

P.S. I asked Bertrand to tag groff 1.23.0.rc2 earlier today.  Happy
     belated Boxing Day.  ;-)

Attachment: signature.asc
Description: PGP signature


[Index of Archives]     [Kernel Documentation]     [Netdev]     [Linux Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux