哪个方法相当于Visual Fox Pro中的Rand(int)到C# [英] which method is equivalent Rand (int) in Visual Fox Pro to C #
问题描述
占用一个在将Visual Fox Pro emigrarlo迁移到C#中制作的方法,我遇到的问题是如何知道Visual Fox Pro中的方法:
occupy a method made in migrating Visual Fox Pro emigrarlo to C #, the problem I have is how to know if the method in Visual Fox Pro:
Rand(intValue)
方法等同于dotNet:
method is equal to dotNet:
Random r = new Random (intValue);
r.Next return ();
假设 intValue = 971 在 dotNET 中生成的结果是 2027119,但我需要等于返回 FoxPro.
assuming that intValue = 971 the result generated in dotNET is 2027119, but I need to be equal to that return FoxPro.
主要问题:我如何确保得到相同的结果?
Primary question: how I can make sure I get the same result?
第二个问题:你知道有什么在线工具fox pro可以证明这个方法给我结果Rand()?
Secondary question: Do you know of any online tool fox pro to prove that this method gives me result Rand ()?
推荐答案
主要问题:如何确保得到相同的结果?
Primary question: how I can make sure I get the same result?
所以你想保证你得到相同的结果......来自两个不同的随机数生成器......对.
So you want to guarantee that you get the same result... from two different random number generators... right.
intValue
在您的 FoxPro 示例中是一个种子值.为什么你需要保证这两个库使用相同的随机数生成器(提示:他们几乎肯定不会).说真的,如果你追求的是随机数,这有什么区别?
intValue
in your FoxPro example is a seed value. Why in the world would you need to guarantee that the two libraries use the same random number generator (HINT: They almost certainly do not). Seriously, if you are after random numbers, what difference does it make?
如果您想要一系列已知的数字,那么您真的根本不需要随机数.这让我很困惑.如果您的代码设置为期望来自随机数生成器的某个值字符串,则存在更大的问题.您也可以使用 FoxPro 中的数字生成地图并从那里获取数字.
If you want a known series of numbers then you really don't want a random number at all. This boggles my mind. If your code is setup to expect a certain string of values from a random number generator then there is a bigger problem. You may as well just generate a map using the numbers from FoxPro and get the numbers from there.
这篇关于哪个方法相当于Visual Fox Pro中的Rand(int)到C#的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!