lua-users home
lua-l archive

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


On Sun, 17 Jan 2010 09:14:33 -0200
Luiz Henrique de Figueiredo <lhf@tecgraf.puc-rio.br> wrote:

> > the math.random function is of poor quality
> 
> To be precise, ANSI C makes no guarantees for its statistical
> properties. However, in Linux, with gnu libc, it does have good
> statistical properties. Apparently, not so for Mac OS X or Windows,
> if I remember correctly. "man srand" in Mac OS X  even says "rand,
> srand -- bad random number generator". "

I seem to recall that even /dev/random under OS X can be unsafe to
use.  So much so that the man page even suggests that you feed it
entropy before reading from it.

(A daemon is responsible for feeding entropy to it normally, but
there's no easy way of knowing if that daemon is still running.)

B.