Пример #1
0
        public void TestZigguratNormalGenerator_Unseeded_InitializesCorrectly()
        {
            var    rng = new ZigguratNormalGenerator();
            double num = rng.Generate();

            Assert.NotNull(rng);
        }
Пример #2
0
        public void TestZigguratGenerator_Unseeded_NeverOverflows()
        {
            var rng = new ZigguratNormalGenerator();

            for (int i = 0; i < 100; i++)
            {
                double num = rng.Generate();
            }

            Assert.NotNull(rng);
        }
Пример #3
0
        public void TestZigguratNormalGenerator_WithSeed_InitializesCorrectly()
        {
            var rng1 = new ZigguratNormalGenerator(seed: 457860009);
            var rng2 = new ZigguratNormalGenerator(seed: 457860009);

            double num1 = rng1.Generate();
            double num2 = rng2.Generate();

            Console.WriteLine(num1);
            Assert.AreEqual(num1, num2);
        }