Special simple random number generator

后端 未结 7 2199
一整个雨季
一整个雨季 2020-12-01 08:47

How to create a function, which on every call generates a random integer number? This number must be most random as possible (according to uniform distribution). It is only

7条回答
  •  北荒
    北荒 (楼主)
    2020-12-01 09:01

    If I write man rand, I can read a possible example, given in POSIX.1-2001, for implementing rand() and srand(). See e.g. here. If you need something more sophisticated, take a look at GNU Scientific Library; you can of course download the code and see the implementation(s).

提交回复
热议问题