How is a random number generated at runtime?

后端 未结 7 1404
被撕碎了的回忆
被撕碎了的回忆 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:16

    You may checkout this article. According to the documentation the specific implementation used in .NET is based on Donald E. Knuth's subtractive random number generator algorithm. For more information, see D. E. Knuth. "The Art of Computer Programming, volume 2: Seminumerical Algorithms". Addison-Wesley, Reading, MA, second edition, 1981.

提交回复
热议问题