Author: fanningpj
Date: Thu Mar 31 20:27:22 2022
New Revision: 1899456
URL: http://svn.apache.org/viewvc?rev=1899456&view=rev
Log:
apply change that stackoverflow (but that does not fix the broken case)
Modified:
poi/trunk/poi/src/main/java/org/apache/poi/ss/formula/functions/Rate.java
Modified:
poi/trunk/poi/src/main/java/org/apache/poi/ss/formula/functions/Rate.java
URL:
http://svn.apache.org/viewvc/poi/trunk/poi/src/main/java/org/apache/poi/ss/formula/functions/Rate.java?rev=1899456&r1=1899455&r2=1899456&view=diff
==============================================================================
--- poi/trunk/poi/src/main/java/org/apache/poi/ss/formula/functions/Rate.java
(original)
+++ poi/trunk/poi/src/main/java/org/apache/poi/ss/formula/functions/Rate.java
Thu Mar 31 20:27:22 2022
@@ -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;
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]