NextUInt() public method

Generates a uint. Values returned are over the full range of a uint, uint.MinValue to uint.MaxValue, inclusive. This is the fastest method for generating a single random number because the underlying random number generator algorithm generates 32 random bits that can be cast directly to a uint.
public NextUInt ( ) : uint
return uint
示例#1
0
        public void NextUInt()
        {
            int sampleCount = 10000000;
            XorShiftRandom rng = new XorShiftRandom();
            double[] sampleArr = new double[sampleCount];

            for(int i=0; i<sampleCount; i++){
                sampleArr[i] = rng.NextUInt();
            }

            UniformDistributionTest(sampleArr, 0.0, uint.MaxValue);
        }