Esempio n. 1
0
        public virtual dynamic CompoundInterestMethod(double principal, double rate, int time, double year)
        {
            // (1 + r/n)
            double body = 1 + _IMaths.Divide(rate, time);
            // nt
            double exponent = _IMaths.Multiply2No(time, year);

            // p(1+r/n)^nt
            return(principal * Math.Pow(body, exponent));
        }
Esempio n. 2
0
        public virtual dynamic SimpleInterestMethod(double principal, double rate, double time, int deniom)
        {
            if (principal < 0 || rate < 0 || time < 0)
            {
                throw new ArgumentOutOfRangeException();
            }
            if (deniom < 0)
            {
                throw new DivideByZeroException();
            }
            double result = _IMaths.Divide(_IMaths.Multiply(principal, rate, time), deniom);

            return(result);
        }
 public double GetInterest(double principalAmount, float Year, double rate) =>
 Maths.Multiply(principalAmount, Year, Maths.Divide(rate, 100));
Esempio n. 4
0
 public double GetInterest(double principalAmount, int Year, double rate, int n) =>
 Maths.Multiply(principalAmount, Math.Pow(Maths.Add(1, Maths.Divide(rate, n)), Maths.Multiply(n, Year)));