예제 #1
0
        public void DivideBy_When_1_00000_d_1_5000_And10Digits_Then_0point02500()
        {
            int      numberOfDigits = 10;
            VeryLong number1        = new VeryLong("1.00000");
            VeryLong number2        = new VeryLong("1.50000");
            VeryLong quotient       = number1.DivideBy(number2, numberOfDigits);

            Assert.AreEqual("0.6666666666", quotient.ToString());
        }
예제 #2
0
        public void DivideBy_When_1_24_d_0_2_And10Digits_Then_0point062()
        {
            int      numberOfDigits = 10;
            VeryLong number1        = new VeryLong("1.24");
            VeryLong number2        = new VeryLong("0.2");
            VeryLong quotient       = number1.DivideBy(number2, numberOfDigits);

            Assert.AreEqual("6.2000000000", quotient.ToString());
        }
예제 #3
0
        public void DivideBy_When_1_d_4_And10Digits_Then_0point25()
        {
            int      numberOfDigits = 10;
            VeryLong number1        = new VeryLong(1.ToString());
            VeryLong number2        = new VeryLong(4.ToString());
            VeryLong quotient       = number1.DivideBy(number2, numberOfDigits);

            Assert.AreEqual("0.2500000000", quotient.ToString());
        }
예제 #4
0
        public void DivideBy_When_1_d_3_And10Digits_Then_0point3333333333()
        {
            int      numberOfDigits = 10;
            VeryLong number1        = new VeryLong("1");
            VeryLong number2        = new VeryLong("3");
            VeryLong quotient       = number1.DivideBy(number2, numberOfDigits);

            Assert.AreEqual("0.3333333333", quotient.ToString());
        }
예제 #5
0
        public void Divide_When_12345_d_53_Then_232_R49()
        {
            VeryLong remainder;
            VeryLong number1  = new VeryLong("12345");
            VeryLong number2  = new VeryLong("53");
            VeryLong quotient = number1.DivideBy(number2, out remainder);

            Assert.AreEqual("232", quotient.ToString());
            Assert.AreEqual("49", remainder.ToString());
        }
예제 #6
0
        public void Divide_When_30000_d_3_Then_10000_R0()
        {
            VeryLong remainder;
            VeryLong number1  = new VeryLong("30000");
            VeryLong number2  = new VeryLong("3");
            VeryLong quotient = number1.DivideBy(number2, out remainder);

            Assert.AreEqual("10000", quotient.ToString());
            Assert.AreEqual("0", remainder.ToString());
        }
예제 #7
0
        public void Divide_When_9_d_2_Then_4_R1()
        {
            VeryLong remainder;
            VeryLong number1  = new VeryLong("9");
            VeryLong number2  = new VeryLong("2");
            VeryLong quotient = number1.DivideBy(number2, out remainder);

            Assert.AreEqual("4", quotient.ToString());
            Assert.AreEqual("1", remainder.ToString());
        }