[erlang-questions] HOWTO GENERATE RANDOM NUMBER?

Christian S chsu79@REDACTED
Thu Dec 6 09:11:45 CET 2007


Remember that you need to seed the random number generator on a
per-process basis. If you do not pass in an explicit seed one will be
initialized and stored for you in the process dictionary.

2007/12/6, Michael McDaniel <erlangx@REDACTED>:
> > How do I create a function in erlang  that will generate a rundom integer number btw say 1 and 10 and return it ?
> 1> random:uniform(10).
> 1
> 2> random:uniform(10).
> 5
> 3> random:uniform(10).
> 8



More information about the erlang-questions mailing list