diff options
-rw-r--r-- | scaddins/source/analysis/analysishelper.cxx | 20 | ||||
-rw-r--r-- | scaddins/source/analysis/analysishelper.hxx | 4 |
2 files changed, 12 insertions, 12 deletions
diff --git a/scaddins/source/analysis/analysishelper.cxx b/scaddins/source/analysis/analysishelper.cxx index 0d950c314629..9594f8e6d6e6 100644 --- a/scaddins/source/analysis/analysishelper.cxx +++ b/scaddins/source/analysis/analysishelper.cxx @@ -1231,36 +1231,36 @@ double GetOddlyield( sal_Int32 nNullDate, sal_Int32 nSettle, sal_Int32 nMat, sal } -double GetRmz( double fInterest, double fNper, double fPv, double fFv, sal_Int32 nPayType ) +double GetRmz( double fRate, double fNper, double fPv, double fFv, sal_Int32 nPayType ) { double fPmt; - if( fInterest == 0.0 ) + if( fRate == 0.0 ) fPmt = ( fPv + fFv ) / fNper; else { - double fTerm = pow( 1.0 + fInterest, fNper ); + double fTerm = pow( 1.0 + fRate, fNper ); if( nPayType > 0 ) - fPmt = ( fFv * fInterest / ( fTerm - 1.0 ) + fPv * fInterest / ( 1.0 - 1.0 / fTerm ) ) / ( 1.0 + fInterest ); + fPmt = ( fFv * fRate / ( fTerm - 1.0 ) + fPv * fRate / ( 1.0 - 1.0 / fTerm ) ) / ( 1.0 + fRate ); else - fPmt = fFv * fInterest / ( fTerm - 1.0 ) + fPv * fInterest / ( 1.0 - 1.0 / fTerm ); + fPmt = fFv * fRate / ( fTerm - 1.0 ) + fPv * fRate / ( 1.0 - 1.0 / fTerm ); } return -fPmt; } -double GetZw( double fInterest, double fNper, double fPmt, double fPv, sal_Int32 nPayType ) +double GetZw( double fRate, double fNper, double fPmt, double fPv, sal_Int32 nPayType ) { double fFv; - if( fInterest == 0.0 ) + if( fRate == 0.0 ) fFv = fPv + fPmt * fNper; else { - double fTerm = pow( 1.0 + fInterest, fNper ); + double fTerm = pow( 1.0 + fRate, fNper ); if( nPayType > 0 ) - fFv = fPv * fTerm + fPmt * ( 1.0 + fInterest ) * ( fTerm - 1.0 ) / fInterest; + fFv = fPv * fTerm + fPmt * ( 1.0 + fRate ) * ( fTerm - 1.0 ) / fRate; else - fFv = fPv * fTerm + fPmt * ( fTerm - 1.0 ) / fInterest; + fFv = fPv * fTerm + fPmt * ( fTerm - 1.0 ) / fRate; } return -fFv; diff --git a/scaddins/source/analysis/analysishelper.hxx b/scaddins/source/analysis/analysishelper.hxx index 6acccd5f4000..2b77d2e6a89c 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 fInterest, double fNper, double fPv, double fFv, sal_Int32 nPayType ); -double GetZw( double fInterest, double fNper, double fPmt, double fPv, sal_Int32 nPayType ); +double GetRmz( double fRate, double fNper, double fPv, double fFv, sal_Int32 nPayType ); +double GetZw( double fRate, double fNper, double fPmt, double fPv, sal_Int32 nPayType ); /// @throws css::uno::RuntimeException /// @throws css::lang::IllegalArgumentException |