summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authorThomas Arnhold <thomas@arnhold.org>2014-08-30 11:04:40 +0200
committerThomas Arnhold <thomas@arnhold.org>2014-08-30 11:12:40 +0200
commite96d2593138d9e8eb197e21fa3087b45eae676c0 (patch)
treeef07fd7dced5db27ef6f2d3fd3f7283d167ff8cb /sc
parentdcda429221ea2a7094835eee792f749a6ae79bc4 (diff)
interpr: ZinsesZins is Compound Interest
There are many more, like ScZinsZ, ScLaufz, ScGetZw,... And some I can't identify, because my financial vocabulary is limited: nZr Zinsrate nZzr Zinseszinsrate nBw ? nZw Zinswert nRmz ? and many many more ;) Change-Id: I11c26a8d4519bbd1e8242d27d3815db2bc3fdecd
Diffstat (limited to 'sc')
-rw-r--r--sc/source/core/inc/interpre.hxx2
-rw-r--r--sc/source/core/tool/interpr2.cxx30
2 files changed, 16 insertions, 16 deletions
diff --git a/sc/source/core/inc/interpre.hxx b/sc/source/core/inc/interpre.hxx
index eb24eb9645f6..dc7de338040e 100644
--- a/sc/source/core/inc/interpre.hxx
+++ b/sc/source/core/inc/interpre.hxx
@@ -682,7 +682,7 @@ void ScZZR();
bool RateIteration(double fNper, double fPayment, double fPv,
double fFv, double fPayType, double& fGuess);
void ScZins();
-double ScGetZinsZ(double fZins, double fZr, double fZzr, double fBw,
+double ScGetCompoundInterest(double fZins, double fZr, double fZzr, double fBw,
double fZw, double fF, double& fRmz);
void ScZinsZ();
void ScKapz();
diff --git a/sc/source/core/tool/interpr2.cxx b/sc/source/core/tool/interpr2.cxx
index 512e756048ed..1326c5fed5e8 100644
--- a/sc/source/core/tool/interpr2.cxx
+++ b/sc/source/core/tool/interpr2.cxx
@@ -1708,27 +1708,27 @@ void ScInterpreter::ScZins()
PushDouble(fGuess);
}
-double ScInterpreter::ScGetZinsZ(double fInterest, double fZr, double fZzr, double fBw,
+double ScInterpreter::ScGetCompoundInterest(double fInterest, double fZr, double fZzr, double fBw,
double fZw, double fF, double& fRmz)
{
fRmz = ScGetRmz(fInterest, fZzr, fBw, fZw, fF); // fuer kapz auch bei fZr == 1
- double fInterestZ;
+ double fCompoundInterest;
nFuncFmtType = NUMBERFORMAT_CURRENCY;
if (fZr == 1.0)
{
if (fF > 0.0)
- fInterestZ = 0.0;
+ fCompoundInterest = 0.0;
else
- fInterestZ = -fBw;
+ fCompoundInterest = -fBw;
}
else
{
if (fF > 0.0)
- fInterestZ = ScGetZw(fInterest, fZr-2.0, fRmz, fBw, 1.0) - fRmz;
+ fCompoundInterest = ScGetZw(fInterest, fZr-2.0, fRmz, fBw, 1.0) - fRmz;
else
- fInterestZ = ScGetZw(fInterest, fZr-1.0, fRmz, fBw, 0.0);
+ fCompoundInterest = ScGetZw(fInterest, fZr-1.0, fRmz, fBw, 0.0);
}
- return fInterestZ * fInterest;
+ return fCompoundInterest * fInterest;
}
void ScInterpreter::ScZinsZ()
@@ -1751,7 +1751,7 @@ void ScInterpreter::ScZinsZ()
else
{
double nRmz;
- PushDouble(ScGetZinsZ(nInterest, nZr, nZzr, nBw, nZw, nFlag, nRmz));
+ PushDouble(ScGetCompoundInterest(nInterest, nZr, nZzr, nBw, nZw, nFlag, nRmz));
}
}
@@ -1775,7 +1775,7 @@ void ScInterpreter::ScKapz()
else
{
double nRmz;
- double nInterestz = ScGetZinsZ(nInterest, nZr, nZzr, nBw, nZw, nFlag, nRmz);
+ double nInterestz = ScGetCompoundInterest(nInterest, nZr, nZzr, nBw, nZw, nFlag, nRmz);
PushDouble(nRmz - nInterestz);
}
}
@@ -1800,22 +1800,22 @@ void ScInterpreter::ScKumZinsZ()
sal_uLong nStart = (sal_uLong) fStart;
sal_uLong nEnd = (sal_uLong) fEnd ;
double fRmz = ScGetRmz(fInterest, fZzr, fBw, 0.0, fF);
- double fInterestZ = 0.0;
+ double fCompoundInterest = 0.0;
if (nStart == 1)
{
if (fF <= 0.0)
- fInterestZ = -fBw;
+ fCompoundInterest = -fBw;
nStart++;
}
for (sal_uLong i = nStart; i <= nEnd; i++)
{
if (fF > 0.0)
- fInterestZ += ScGetZw(fInterest, (double)(i-2), fRmz, fBw, 1.0) - fRmz;
+ fCompoundInterest += ScGetZw(fInterest, (double)(i-2), fRmz, fBw, 1.0) - fRmz;
else
- fInterestZ += ScGetZw(fInterest, (double)(i-1), fRmz, fBw, 0.0);
+ fCompoundInterest += ScGetZw(fInterest, (double)(i-1), fRmz, fBw, 0.0);
}
- fInterestZ *= fInterest;
- PushDouble(fInterestZ);
+ fCompoundInterest *= fInterest;
+ PushDouble(fCompoundInterest);
}
}
}