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:
(100000*(1+A1)^180*A1)/((1+A1)^180-1)
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?