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

CalculateRate(double,double,double,double,double,double)@Rate can calculate a wrong rate. #1226

Closed
tohidemyname opened this issue Nov 27, 2023 · 0 comments · Fixed by #1286
Closed

Comments

@tohidemyname
Copy link

NPOI Version

master

The code is as follows:

private double CalculateRate(double nper, double pmt, double pv, double fv, double type, double guess)
{...
f = Math.Exp(nper * Math.Log(1 + rate));
...}

An early version of POI calculates in the same way:

private double calculateRate(double nper, double pmt, double pv, double fv, doub
...
f = Math.exp(nper * Math.log(1 + rate));
..}

However, the above code is revised:

private double calculateRate(double nper, double pmt, double pv, double fv, doub
...
f = Math.pow(1 + rate, nper);
..}

The patch is as follows:
apache/poi@728c2d3

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

Successfully merging a pull request may close this issue.

2 participants