- #1

- 16

- 0

## Homework Statement

Working on a computer program that will create an amortization table (a table that lists each payment on an amortizing loan). I am going to use a simple c++ array to store each row of data, and need to know the number of months required to pay off a given loan so that i know the number of rows needed to initialize in the array.

I searched the internet for a formula to calculate this value (time in months to pay off the loan).

## Homework Equations

This is the equation I found:

T = -log(1 - I x L / P) / log(1 + I)

in LaTeX:

[tex] T = \frac{- log(1-I \times L)}{log(1+I)}[/tex]

Where

T is the time to pay off the loan (in months)

I is the monthly interest rate

P is the amount of each payment

## The Attempt at a Solution

I can take it on blind faith that this works, but I'd rather not. What seems like a simple, straightforward calculation is confusing me because of the nature of the log() function. What IS its function? What is its purpose in this equation? What is it doing here? HOW DOES IT WORK?

This question has been with me for some time and this seems the perfect opportunity to finally understand it. Any help would be greatly appreciated.

Last edited: