Link to home
Start Free TrialLog in
Avatar of CWS (haripriya)
CWS (haripriya)Flag for India

asked on

APR calculation help

Hi, I want to calculate APR based on the inputs C, E, R and N.
Here is the math to solve:
http://www.efunda.com/formulae/finance/apr_calculator.cfm

I want to write in my php to calculate the APR.  But, I don't know how to solve this equation.
If not php, atleaset explain in whatever language you know, i can convert it to php.

Any help is appreciated.
Thanks.
Avatar of WaterStreet
WaterStreet
Flag of United States of America image

Use the following formula

P = (C+E)r((1+r)^N)/((1+r)^N)-1)

The "^" symbol is whatever you programming language uses for raising to a power
Avatar of CWS (haripriya)

ASKER

Hi,
Thanks for the quick reply. P is Monthly payment. I want to calculate the APR, for which they have given a formula which should be solved using Newton Raphsons iterative method, that is where  i am stuck.
I can't apply the Newton Raphsons iterative method.

Maybe someone else here can help.  I'll stay subscribed.
ok.
I solved my problem.
This is the equation I used for Newton - Raphson method.

while ((apr_next>apr+my_range_top)||(apr_next<apr)) {
apr=apr_next;
apr_next=P/loanamount*(Math.pow(1+parseFloat(apr),term)-1)/(Math.pow(1+parseFloat(apr),term));
}


This is not my code. I copied from a website.
Will close the question now.
ASKER CERTIFIED SOLUTION
Avatar of CWS (haripriya)
CWS (haripriya)
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Okay.  Thanks

We're just waiting for the Community Support Moderator to close the question with points refunded and your posting 24012688 as the accepted solution.
fine with me.