CWS (haripriya)
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.
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.
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.
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.
Maybe someone else here can help. I'll stay subscribed.
ASKER
ok.
ASKER
I solved my problem.
This is the equation I used for Newton - Raphson method.
while ((apr_next>apr+my_range_to p)||(apr_n ext<apr)) {
apr=apr_next;
apr_next=P/loanamount*(Mat h.pow(1+pa rseFloat(a pr),term)- 1)/(Math.p ow(1+parse Float(apr) ,term));
}
This is not my code. I copied from a website.
Will close the question now.
This is the equation I used for Newton - Raphson method.
while ((apr_next>apr+my_range_to
apr=apr_next;
apr_next=P/loanamount*(Mat
}
This is not my code. I copied from a website.
Will close the question now.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
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.
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.
P = (C+E)r((1+r)^N)/((1+r)^N)-
The "^" symbol is whatever you programming language uses for raising to a power