apply change that stackoverflow (but that does not fix the broken case)

git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1899456 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
PJ Fanning 2022-03-31 20:27:22 +00:00
parent 9d89bc1604
commit 728c2d36cf
1 changed files with 2 additions and 2 deletions

View File

@ -66,7 +66,7 @@ public class Rate implements Function {
checkValue(rate);
} catch (EvaluationException e) {
LOG.atError().withThrowable(e).log("Can't evaluate rate function")
LOG.atError().withThrowable(e).log("Can't evaluate rate function");
return e.getErrorEval();
}
@ -83,7 +83,7 @@ public class Rate implements Function {
if (Math.abs(rate) < FINANCIAL_PRECISION) {
y = pv * (1 + nper * rate) + pmt * (1 + rate * type) * nper + fv;
} else {
f = Math.exp(nper * Math.log(1 + rate));
f = Math.pow(1 + rate, nper);
y = pv * f + pmt * (1 / rate + type) * (f - 1) + fv;
}
y0 = pv + pmt * nper + fv;