summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--scaddins/source/analysis/analysishelper.cxx36
-rw-r--r--scaddins/source/analysis/analysishelper.hxx4
2 files changed, 20 insertions, 20 deletions
diff --git a/scaddins/source/analysis/analysishelper.cxx b/scaddins/source/analysis/analysishelper.cxx
index 22328b2d2373..8331565dd0ca 100644
--- a/scaddins/source/analysis/analysishelper.cxx
+++ b/scaddins/source/analysis/analysishelper.cxx
@@ -1231,39 +1231,39 @@ double GetOddlyield( sal_Int32 nNullDate, sal_Int32 nSettle, sal_Int32 nMat, sal
}
-double GetRmz( double fZins, double fZzr, double fBw, double fZw, sal_Int32 nF )
+double GetRmz( double fInterest, double fNper, double fPv, double fFv, sal_Int32 nPayType )
{
- double fRmz;
- if( fZins == 0.0 )
- fRmz = ( fBw + fZw ) / fZzr;
+ double fPmt;
+ if( fInterest == 0.0 )
+ fPmt = ( fPv + fFv ) / fNper;
else
{
- double fTerm = pow( 1.0 + fZins, fZzr );
- if( nF > 0 )
- fRmz = ( fZw * fZins / ( fTerm - 1.0 ) + fBw * fZins / ( 1.0 - 1.0 / fTerm ) ) / ( 1.0 + fZins );
+ double fTerm = pow( 1.0 + fInterest, fNper );
+ if( nPayType > 0 )
+ fPmt = ( fFv * fInterest / ( fTerm - 1.0 ) + fPv * fInterest / ( 1.0 - 1.0 / fTerm ) ) / ( 1.0 + fInterest );
else
- fRmz = fZw * fZins / ( fTerm - 1.0 ) + fBw * fZins / ( 1.0 - 1.0 / fTerm );
+ fPmt = fFv * fInterest / ( fTerm - 1.0 ) + fPv * fInterest / ( 1.0 - 1.0 / fTerm );
}
- return -fRmz;
+ return -fPmt;
}
-double GetZw( double fZins, double fZzr, double fRmz, double fBw, sal_Int32 nF )
+double GetZw( double fInterest, double fNper, double fPmt, double fPv, sal_Int32 nPayType )
{
- double fZw;
- if( fZins == 0.0 )
- fZw = fBw + fRmz * fZzr;
+ double fFv;
+ if( fInterest == 0.0 )
+ fFv = fPv + fPmt * fNper;
else
{
- double fTerm = pow( 1.0 + fZins, fZzr );
- if( nF > 0 )
- fZw = fBw * fTerm + fRmz * ( 1.0 + fZins ) * ( fTerm - 1.0 ) / fZins;
+ double fTerm = pow( 1.0 + fInterest, fNper );
+ if( nPayType > 0 )
+ fFv = fPv * fTerm + fPmt * ( 1.0 + fInterest ) * ( fTerm - 1.0 ) / fInterest;
else
- fZw = fBw * fTerm + fRmz * ( fTerm - 1.0 ) / fZins;
+ fFv = fPv * fTerm + fPmt * ( fTerm - 1.0 ) / fInterest;
}
- return -fZw;
+ return -fFv;
}
// financial functions COUP***
diff --git a/scaddins/source/analysis/analysishelper.hxx b/scaddins/source/analysis/analysishelper.hxx
index 280c4a396861..e644d4fa3e72 100644
--- a/scaddins/source/analysis/analysishelper.hxx
+++ b/scaddins/source/analysis/analysishelper.hxx
@@ -155,8 +155,8 @@ double GetOddlprice( sal_Int32 nNullDate, sal_Int32 nSettle, sal_In
/// @throws css::lang::IllegalArgumentException
double GetOddlyield( sal_Int32 nNullDate, sal_Int32 nSettle, sal_Int32 nMat, sal_Int32 nLastInterest,
double fRate, double fPrice, double fRedemp, sal_Int32 nFreq, sal_Int32 nBase );
-double GetRmz( double fZins, double fZzr, double fBw, double fZw, sal_Int32 nF );
-double GetZw( double fZins, double fZzr, double fRmz, double fBw, sal_Int32 nF );
+double GetRmz( double fInterest, double fNper, double fPv, double fFv, sal_Int32 nPayType );
+double GetZw( double fInterest, double fNper, double fPmt, double fPv, sal_Int32 nPayType );
/// @throws css::uno::RuntimeException
/// @throws css::lang::IllegalArgumentException