任何人都可以了解这个System.Random算法吗?

问题描述

有人可以了解此处使用其他值的影响吗?

CLR System.Random(random.cs,61)似乎引用了所使用的算法

//This algorithm comes from Numerical Recipes in C (2nd Ed.)

并使用此行代码(random.cs,80)

 inextp = 21;    
 
 

但是,看看正在使用的明显算法(C中的数字食谱,283)

 inextp=31; The constant 31 is special; see knuth.

knuth 124)讨论了随机生成的曲线下的分布区域被分成31个矩形。

我不是数学专家,尝试遵循该算法会使我的大脑有点受伤。

random.cs。 Microsoft参考源.NET Framework 4.8 https://referencesource.microsoft.com/#mscorlib/system/random.cs

Press,Teukolsky等。等人,《 C中的数字食谱:科学计算的艺术》,第二版。 https://www.cec.uchile.cl/cinetica/pcordero/MC_libros/NumericalRecipesinC.pdf

Donald knuth,《计算机编程艺术》第三版,第一卷。 2个半数字的心律 https://seriouscomputerist.atariverse.com/media/pdf/book/Art%20of%20Computer%20Programming%20-%20Volume%202%20(Seminumerical%20Algorithms).pdf

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)