Initializing random seeds

Daniel Luna daniel@REDACTED
Wed Feb 8 17:14:59 CET 2006


On Wed, 8 Feb 2006, Ulf Wiger (AL/EAB) wrote:
> A curious aspect of random.erl is that the
> random:seed/1 function returns the _old_ value,
> and there is no get_seed() function.

I can provide you with one :-)

get_seed() ->
   Seed = random:seed({1,1,1}),
   random:seed(Seed),
   Seed.

:-)

/Luna
-- 
Daniel Luna                  | Current projects:
daniel@REDACTED |  - Consulting in Rome
Yes, I'm one of those now.   |  - Learning Yaws
www.erlang-consulting.com    |  - Looking for thesis ideas



More information about the erlang-questions mailing list