Ejemplo n.º 1
0
        public static void Random_clamped_normal_range_zero()
        {
            const int    count = 150_000;
            const double min   = 10;
            const double max   = 10;

            var normal = Normal.Between(min, max, Seed);

            double[] values = normal.Sample(count).ToArray();

            Assert.All(values, n => Assert.True(n == min));
        }
Ejemplo n.º 2
0
        public static void Random_clamped_normal()
        {
            const int    count = 100_000;
            const double min   = 10;
            const double max   = 1500;

            var normal = Normal.Between(min, max, Seed);

            double[] values = normal.Sample(count).ToArray();

            Assert.All(values, n => Assert.True(n >= min && n <= max));

            int groupCount = values
                             .GroupBy(n => n)
                             .Count();

            Assert.True(groupCount >= 1000); // 1,479
        }