Exemple #1
0
        public static void Double()
        {
            bool     result = true;
            Random32 x      = new Random32(47);

            for (int i = 0; i < Tests.Double4.NUM_TESTS; i++)
            {
                bool   b = x.NextBool();
                double a = maxmath.negate(Tests.Double4.TestData_LHS[i].x, b);

                result &= a == (b ? -Tests.Double4.TestData_LHS[i].x : Tests.Double4.TestData_LHS[i].x);
            }

            Assert.AreEqual(true, result);
        }
Exemple #2
0
        public static void Float()
        {
            bool     result = true;
            Random32 x      = new Random32(47);

            for (int i = 0; i < Tests.Float8.NUM_TESTS; i++)
            {
                bool  b = x.NextBool();
                float a = maxmath.negate(Tests.Float8.TestData_LHS[i].x0, b);

                result &= a == (b ? -Tests.Float8.TestData_LHS[i].x0 : Tests.Float8.TestData_LHS[i].x0);
            }

            Assert.AreEqual(true, result);
        }