示例#1
0
        public void TestPmt()
        {
            double f, r, y, p, x;
            int    n;
            bool   t = false;

            r = 0; n = 3; p = 2; f = 7; t = true;
            y = FinanceLib.pmt(r, n, p, f, t);
            x = -3;
            Assert.AreEqual(x, y, "pmt ");

            // cross check with pv
            r = 1; n = 10; p = -109.66796875; f = 10000; t = false;
            y = FinanceLib.pmt(r, n, p, f, t);
            x = 100;
            Assert.AreEqual(x, y, "pmt ");

            r = 1; n = 10; p = -209.5703125; f = 10000; t = true;
            y = FinanceLib.pmt(r, n, p, f, t);
            x = 100;
            Assert.AreEqual(x, y, "pmt ");

            // cross check with fv
            r = 2; n = 12; f = -6409178400d; p = 12000; t = false;
            y = FinanceLib.pmt(r, n, p, f, t);
            x = 120;
            Assert.AreEqual(x, y, "pmt ");

            r = 2; n = 12; f = -6472951200d; p = 12000; t = true;
            y = FinanceLib.pmt(r, n, p, f, t);
            x = 120;
            Assert.AreEqual(x, y, "pmt ");
        }
示例#2
0
 public override double Evaluate(double rate, double arg1, double arg2, double arg3, bool type)
 {
     return(FinanceLib.pmt(rate, arg1, arg2, arg3, type));
 }