Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Mortgage payment algorithm

Status
Not open for further replies.

DerPflug

Programmer
Mar 28, 2002
153
0
0
US
I'm trying to get a monthly payment algorithm to work but I seem to be messing up with the order of precedence or something. I'm not sure. The algorithm is:

(P * R * (1 + R)^L)/((1 + R)^L - 1)

P = principal = $1000
R = interest rate = %10
L = length of loan = 12 months

With these values the monthly payment should be 87.92.

I currently have:
payment = (P * R * pow(1 + R,L))/(pow(1 + R,L) - 1);
but this doesn't seem to work. Any ideas?
 
R is 0.10, not 10, right?

/Per
[sub]Nerdy signatures are as lame as the inconsistent stardates of STTNG.[/sub]
 
Yes, R is .10. My problem was that I wasn't dividing the interest by 12.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top