コード例 #1
0
        public void Test()
        {
            int     periods = Financial.NumberOfPeriods(0.04875m / 12, -478.05m, 85500.00m);
            decimal low     = 0;
            decimal high    = 478.05m;
            var     test    = Numeric.Bisect(ref low, ref high, 0.01m, extra =>
            {
                int adjustedPeriods = Financial.NumberOfPeriods(0.04875m / 12, -478.05m, 85500.00m - extra);
                if (adjustedPeriods <= periods)
                {
                    return(1);
                }
                return(-1);
            });

            Assert.IsFalse(test);
        }