예제 #1
0
        public void QuotRemTest()
        {
            int[] param1     = { 10, -10 }, param2 = { 3, -3 };
            var   prodParams =
                from n0 in param1
                from n1 in param2
                select new { n0, n1 };

            foreach (var tup in prodParams)
            {
                int ansQ = tup.n0 / tup.n1, ansR = tup.n0 % tup.n1;
                Assert.AreEqual(ansQ, Classic.QuotM(tup.n0, tup.n1), "QuotTest");
                Assert.AreEqual(ansR, Classic.RemM(tup.n0, tup.n1), "RemTest");
            }
        }
예제 #2
0
        public bool QuotRemProp(uint x, uint y)
        {
            int m = (int)x % 201 - 50, n = (int)y % 150 + 1;

            return((m / n) == Classic.QuotM(m, n) && (m % n) == Classic.RemM(m, n));
        }