Ejemplo n.º 1
0
        public static void Bool2()
        {
            bool result = true;

            Random32 rng = new Random32(RNG_SEED);

            for (int i = 0; i < NUM_TESTS; i++)
            {
                bool2 x = rng.NextBool2();

                int test = maxmath.first(x);

                int j = 0;
                while (j < 2 && !x[j])
                {
                    j++;
                }

                result &= test == j;
            }

            int testt = maxmath.first(default(bool2));

            Assert.AreEqual(result && maxmath.first(default(bool2)) == 4, true);
        }
Ejemplo n.º 2
0
        public static void Bool2()
        {
            bool result = true;

            Random32 rng = new Random32(RNG_SEED);

            for (int i = 0; i < NUM_TESTS; i++)
            {
                bool2 x = rng.NextBool2();

                int test = 0;

                for (int j = 0; j < 2; j++)
                {
                    if (x[j])
                    {
                        test++;
                    }
                }

                result &= test == maxmath.count(x);
            }

            Assert.AreEqual(true, result);
        }
Ejemplo n.º 3
0
        public static void Long2()
        {
            bool     result = true;
            Random32 x      = new Random32(47);

            for (int i = 0; i < Tests.Long2.NUM_TESTS; i++)
            {
                bool2 b = x.NextBool2();
                long2 a = maxmath.negate(Tests.Long2.TestData_LHS[i], b);

                result &= math.all(a == (maxmath.select(Tests.Long2.TestData_LHS[i], -Tests.Long2.TestData_LHS[i], b)));
            }

            Assert.AreEqual(true, result);
        }
Ejemplo n.º 4
0
        public static void Bool2()
        {
            bool result = true;

            Random32 rng = new Random32(RNG_SEED);

            for (int i = 0; i < NUM_TESTS; i++)
            {
                bool2 x = rng.NextBool2();

                int test = maxmath.last(x);

                int j = 1;
                while (j != -1 && !x[j])
                {
                    j--;
                }

                result &= test == j;
            }

            Assert.AreEqual(result && maxmath.last(default(bool2)) == -1, true);
        }