Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Finance.js IRR function problem. #7

Open
eastmoon opened this issue Oct 7, 2015 · 2 comments
Open

Finance.js IRR function problem. #7

eastmoon opened this issue Oct 7, 2015 · 2 comments

Comments

@eastmoon
Copy link

eastmoon commented Oct 7, 2015

Hi, Essam.
I am Jacky from Taiwan.

Few day ago, my friend has a project use Finance.js, IRR function.
But, function was not enough precision than Excel IRR function.
So, my friend ask for my help

I look your program, and find 2 issues.

  1. dynamic guess variable isn't exist, and decimal is not enough.
  2. recursive call will happen stack error.

First, i tell to my friend to modify your program at some const variable.
That will fix issues 1, but at same time it will happen issues 2.
Because i use more decimal and more precision guess, it mean time complexity will grow, in recursive call it also mean more stack.

So, i write a do-while version to calculate, but performance still limit by browser.
Then, i write a burst-guess to speed-up, when VPN too huge.
e.g : Math.log(VPN).

My code is over here.
https://github.com/eastmoon/Tutorial-JavaScript/blob/master/Issues-FinanceIRR/Index.html

Hope it would be helpful for you

@jasonfungsing
Copy link

@eastmoon Tested your linked code. looks like it is still not correct.

@eastmoon
Copy link
Author

@jasonfungsing What's wrong has happened ?
Could you give me data and result ?
It will help me know how to fix it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants