int numOfMonths = numOfYears * 12; float monthlyRepayments; float actualRate = (rate/100)/12; //monthlyRepayments = (borrowAmount*(pow((1+actualRate),numOfMonths))*actualRate)/((pow((1+actualRate),numOfMonths))-1); monthlyRepayments = (100000 * (pow((1+actualRate),180) * actualRate))/((pow((1+actualRate),180))-1);
Ok this is the actual equation:
btw A1 =0.06/12
So the commented line is original one I tried, didn't work. So I tried just putting numbers in rather than bringing them in through the function, didn't work.
If I cout << monthlyRepayments it displays this (for both): -1.#IND
Which is what the eh?