Am 14.11.2012 20:20, schrieb Hans Hagen:
> On 11/14/2012 7:55 PM, Peter Rolf wrote:
>> Hi,
>>
>> in one of my documents I use a specific random seed to create a fixed
>> random based graphic (size, color, position). This works fine under
>> Windows (where I 'found' the seed value), but I get a complete different
>> result on my Debian system.
>>
>> Is there a way to get identical results on different OS? Or is the
>> random number generator OS specific? Just wondering...
> 
> yes and it cannot be trusted either (some underlying os code is used); i
> also found out that you need to call a couple of random's in a row first
> to get at least not the same ones in the beginning
> 
> in contetx I've now settled on:
> 
> math.initialseed =
> tonumber(string.sub(string.reverse(tostring(ceil(socket and
> socket.gettime()*10000 or time()))),1,6))
> 
> 
Thanks for the info. The formula looks like an incantation for the god
of random numbers ;-)

I already migrated the tex code to lua, so that I can do some post
processing on the collected random based data. To get identical results,
I only have to save the final data set then.

___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

Reply via email to