(adsbygoogle = window.adsbygoogle || []).push({}); 1. The problem statement, all variables and given/known data

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).

2. Relevant 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

3. 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.

**Physics Forums | Science Articles, Homework Help, Discussion**

The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

# Homework Help: Understanding the log() function

**Physics Forums | Science Articles, Homework Help, Discussion**