How is a random number generated at runtime?

后端 未结 7 1361
被撕碎了的回忆
被撕碎了的回忆 2020-12-03 14:28

Since computers cannot pick random numbers(can they?) how is this random number actually generated. For example in C# we say,

Random.Next()

7条回答
  •  情歌与酒
    2020-12-03 15:06

    I don't know much details but what I know is that a seed is used in order to generate the random numbers it is then based on some algorithm that uses that seed that a new number is obtained.

    If you get random numbers based on the same seed they will be the same often.

提交回复
热议问题