How to generate a random int in C?

后端 未结 27 2127
故里飘歌
故里飘歌 2020-11-22 00:31

Is there a function to generate a random int number in C? Or will I have to use a third party library?

27条回答
  •  攒了一身酷
    2020-11-22 00:37

    Have a look at ISAAC (Indirection, Shift, Accumulate, Add, and Count). Its uniformly distributed and has an average cycle length of 2^8295.

提交回复
热议问题