NextDoubleNonZero() public méthode

Generates a random double. Values returned are over the range (0, 1). That is, exclusive of both 0.0 and 1.0.
public NextDoubleNonZero ( ) : double
Résultat double
        public void NextDoubleNonZero()
        {
            int sampleCount = 10000000;
            XorShiftRandom rng = new XorShiftRandom();
            double[] sampleArr = new double[sampleCount];

            for(int i=0; i<sampleCount; i++)
            {
                sampleArr[i] = rng.NextDoubleNonZero();
                if(0.0 == sampleArr[i]) Assert.Fail();
            }

            UniformDistributionTest(sampleArr, 0.0, 1.0);
        }