Eric wrote On 05/19/06 20:40,:
Richard Heathfield wrote:
interesting.
m would be rand_max-1 i think
a and c would be prime numbers maybe? (well, that was my choice)
and initial value of r would be the seed.
I played with this once i saw your post and it seems quite workable
as a pseudo random generator. Its also extremely easy to implement.
I love little tidbits like this!
From your speculations about appropriate values for
m, a, and c, it is clear that you have no knowledge at
all about what they should be. You therefore deserve
the Bad Things that are likely to happen to you if you
decide to implement any such "little tidbit." Alas, it
is only too likely that you will code it into a program
someone else will use, thus inflicting your ignorance
upon innocent bystanders.
If you can't be bothered to do any research at all,
there's no hope. But in hope you can be persuaded to
lift a finger five times and make a few mouse clicks,
I offer one word: RANDU.