[erlang-questions] HOWTO GENERATE RANDOM NUMBER?

Bob Ippolito bob@REDACTED
Thu Dec 6 12:23:00 CET 2007


And if you need a random number generator that doesn't need to be
seeded per-process then you should use the crypto module. The PRNG
used by the crypto module is also far better, if the quality of the
random numbers happens to matter.

-bob

On 12/6/07, Christian S <chsu79@REDACTED> wrote:
> 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
> _______________________________________________
> erlang-questions mailing list
> erlang-questions@REDACTED
> http://www.erlang.org/mailman/listinfo/erlang-questions
>



More information about the erlang-questions mailing list