【发布时间】:2010-07-26 16:48:12
【问题描述】:
好的,我刚刚拿起一个硬件RNG,它包含一些简单的功能,如下所示,
GetRandomBytes(UInt Length,out object Array)
GetRandomDoubles(UInt Length,out object Array)
这些函数似乎很好地解释了自己,如何有效地使用这些函数来生成某个范围内的数字?
更多信息来自我们发现的一些文档,
GetRandomByte
Return a single byte containing 8 random bits.
GetRandomWord
Return an unsigned integer containing 32 random bits.
GetRandomDouble
Returns a double-precision floating point value uniformly
distributed between 0 (inclusive) and 1 (exclusive).
GetRandomBytes
GetRandomWords
GetRandomDoubles
Fill in an array with random values. These methods all take
two arguments, an integer specifying the number of values
to return (as an unsigned long integer), and the array to
return the values in (as a COM Variant).
【问题讨论】:
-
这些函数从何而来?
-
@Darin Dimitrov,这些是捆绑在随硬件提供的 ActiveX COM 组件中的功能。哦,我还没有拿到硬件,我只是在为它到来做准备。