mirror of https://github.com/apache/poi.git
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:
parent
9d89bc1604
commit
728c2d36cf
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue