Re: Proposal: Addition of a random number generator to GLib

Sebastian Wilhelmi <> writes:

> Why provide a ..._int_range function?
> Because often people do this by writing rand()%CONSTANT. This however in
> general yields random numbers of bad quality. If we provide a function to=
> do that, we will improve the quality of random numbers. (on the cost of
> speed though).

I thought the poor quality of the low bits was a artifact
of the typical linear-congruential generator found on
older systems. (I don't think that the standard rand()
on glibc systems even is vulnerable to that, and the
Mersenne twister certainly shouldn't be if it is as
good as claimed...)


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