How to create a list of 1000 random numbers in Erlang?

后端 未结 6 1902
深忆病人
深忆病人 2020-12-17 15:38

I\'m sure that there is a function for that. I just want to make a list of 1000 numbers, each one of them which should be random.

6条回答
  •  庸人自扰
    2020-12-17 16:34

    You need to correctly seed first of all.

    _ = rand:seed(exs1024s),
    [rand:uniform(100) || _ <- lists:seq(1, 1000)].
    

提交回复
热议问题