lua-users home
lua-l archive

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

On Tue, Mar 16, 2010 at 3:54 AM, Christopher Eykamp <> wrote:
> When I run the following snippet, I get unexpected results.  About 50% of
> the results are the same (I've omitted the different ones from my results
> list, because they're not as interesting :-)
> math.randomseed( __randomSeed )
> print ("Seed: ".. __randomSeed,
> math.random(10000),math.random(10000),math.random(10000),math.random(10000))

are you sure the RNG isn't 'reseeded' before the call to print() ?
what platform are you using?

on two _very_ different platforms (a kubuntu Linux x86_64 and an
embedded MIPS box) i get consistent results with same seeds, but not
the values you're seeing there.