0

I would like to know to define the formula of ppf (public provident fund )in java code.

I have tried

p*(Math.pow(1+i/100,t));

but I am getting it wrong

Pff formula is:

F = P[{(1+i)n-1}/i]

where,

  • ‘F’ stands for the maturity amount of the PPF
  • ‘P’ stands for the annual instalments paid
  • ‘n’ stands for the number of years or tenure of the PPF
  • ‘i’ stands for the rate of interest.

The formula works like duration - 3 years and interest -7.1%

1 0 1,00,000 7,100.04 1,07,100

2 1,07,100 1,00,000 14,704.08 2,21,804

3 2,21,804 1,00,000 22,848.12 3,44,652

  • 1
    PLease make a [MRE] and provide the error message – peer Aug 17 '21 at 08:18
  • What is `t` and `p`? Is `(1+i)n-1` suppose to be `(1+i)` to the power of `n-1`? What are you getting from your code? What did you expect it to be? – Scratte Aug 17 '21 at 12:52
  • T refer to time and p is refer to the principal amount. I am getting a correct and if I put a small number but when I pass big number so I am getting a wrong answer – Syed Ashraf khalid Aug 18 '21 at 06:32

0 Answers0