diff options
Diffstat (limited to 'scaddins/source/analysis')
-rw-r--r-- | scaddins/source/analysis/analysishelper.cxx | 6 | ||||
-rw-r--r-- | scaddins/source/analysis/financial.cxx | 18 |
2 files changed, 12 insertions, 12 deletions
diff --git a/scaddins/source/analysis/analysishelper.cxx b/scaddins/source/analysis/analysishelper.cxx index 56064b56f884..b075bafe0148 100644 --- a/scaddins/source/analysis/analysishelper.cxx +++ b/scaddins/source/analysis/analysishelper.cxx @@ -1176,7 +1176,7 @@ double GetZw( double fZins, double fZzr, double fRmz, double fBw, sal_Int32 nF ) //------- // COUPPCD: find last coupon date before settlement (can be equal to settlement) -void lcl_GetCouppcd( ScaDate& rDate, const ScaDate& rSettle, const ScaDate& rMat, sal_Int32 nFreq ) +static void lcl_GetCouppcd( ScaDate& rDate, const ScaDate& rSettle, const ScaDate& rMat, sal_Int32 nFreq ) throw( lang::IllegalArgumentException ) { rDate = rMat; @@ -1201,7 +1201,7 @@ double GetCouppcd( sal_Int32 nNullDate, sal_Int32 nSettle, sal_Int32 nMat, sal_I //------- // COUPNCD: find first coupon date after settlement (is never equal to settlement) -void lcl_GetCoupncd( ScaDate& rDate, const ScaDate& rSettle, const ScaDate& rMat, sal_Int32 nFreq ) +static void lcl_GetCoupncd( ScaDate& rDate, const ScaDate& rSettle, const ScaDate& rMat, sal_Int32 nFreq ) throw( lang::IllegalArgumentException ) { rDate = rMat; @@ -2535,7 +2535,7 @@ ConvertDataList::ConvertDataList( void ) NEWD( "Humpen", 2.0, CDC_Volume ); // *** NEWD( "ly3", 1.1810108125623799E-51, CDC_Volume ); // *** Cubic light-year NEWD( "MTON", 1.4125866688595436E00, CDC_Volume ); // *** Measurement ton - NEWD( "tspm", 5.0000000000000000E02, CDC_Volume ); // *** Modern teaspoon + NEWD( "tspm", 2.0000000000000000E02, CDC_Volume ); // *** Modern teaspoon NEWD( "uk_gal", 2.1996924829908779E-01, CDC_Volume ); // U.K. / Imperial gallon 1/4.54609 NEWD( "uk_qt", 8.7987699319635115E-01, CDC_Volume ); // U.K. / Imperial quart 1/4 imperial gallon diff --git a/scaddins/source/analysis/financial.cxx b/scaddins/source/analysis/financial.cxx index 18e0f04ca733..eb1cac59a372 100644 --- a/scaddins/source/analysis/financial.cxx +++ b/scaddins/source/analysis/financial.cxx @@ -199,7 +199,7 @@ double SAL_CALL AnalysisAddIn::getPrice( constREFXPS& xOpt, sal_Int32 nSettle, sal_Int32 nMat, double fRate, double fYield, double fRedemp, sal_Int32 nFreq, const ANY& rOB ) THROWDEF_RTE_IAE { - if( fYield < 0.0 || fRate < 0.0 || fRedemp <= 0 || CHK_Freq || nSettle >= nMat ) + if( fYield < 0.0 || fRate < 0.0 || fRedemp <= 0.0 || CHK_Freq || nSettle >= nMat ) THROW_IAE; double fRet = getPrice_( GetNullDate( xOpt ), nSettle, nMat, fRate, fYield, fRedemp, nFreq, getDateMode( xOpt, rOB ) ); @@ -210,7 +210,7 @@ double SAL_CALL AnalysisAddIn::getPrice( constREFXPS& xOpt, double SAL_CALL AnalysisAddIn::getPricedisc( constREFXPS& xOpt, sal_Int32 nSettle, sal_Int32 nMat, double fDisc, double fRedemp, const ANY& rOB ) THROWDEF_RTE_IAE { - if( fDisc <= 0.0 || fRedemp <= 0 || nSettle >= nMat ) + if( fDisc <= 0.0 || fRedemp <= 0.0 || nSettle >= nMat ) THROW_IAE; double fRet = fRedemp * ( 1.0 - fDisc * GetYearDiff( GetNullDate( xOpt ), nSettle, nMat, getDateMode( xOpt, rOB ) ) ); @@ -336,7 +336,7 @@ double SAL_CALL AnalysisAddIn::getYieldmat( constREFXPS& xOpt, sal_Int32 nSettle, sal_Int32 nMat, sal_Int32 nIssue, double fRate, double fPrice, const ANY& rOB ) THROWDEF_RTE_IAE { - if( fRate < 0.0 || fRate <= 0.0 || nSettle >= nMat ) + if( fPrice <= 0.0 || fRate <= 0.0 || nSettle >= nMat ) THROW_IAE; double fRet = GetYieldmat( GetNullDate( xOpt ), nSettle, nMat, nIssue, fRate, fPrice, getDateMode( xOpt, rOB ) ); @@ -401,7 +401,7 @@ double SAL_CALL AnalysisAddIn::getOddfprice( constREFXPS& xOpt, sal_Int32 nSettle, sal_Int32 nMat, sal_Int32 nIssue, sal_Int32 nFirstCoup, double fRate, double fYield, double fRedemp, sal_Int32 nFreq, const ANY& rOB ) THROWDEF_RTE_IAE { - if( fRate < 0 || fYield < 0 || CHK_Freq || nMat <= nFirstCoup || nFirstCoup <= nSettle || nSettle <= nIssue ) + if( fRate < 0.0 || fYield < 0.0 || CHK_Freq || nMat <= nFirstCoup || nFirstCoup <= nSettle || nSettle <= nIssue ) THROW_IAE; double fRet = GetOddfprice( GetNullDate( xOpt ), nSettle, nMat, nIssue, nFirstCoup, fRate, fYield, fRedemp, nFreq, getDateMode( xOpt, rOB ) ); @@ -413,7 +413,7 @@ double SAL_CALL AnalysisAddIn::getOddfyield( constREFXPS& xOpt, sal_Int32 nSettle, sal_Int32 nMat, sal_Int32 nIssue, sal_Int32 nFirstCoup, double fRate, double fPrice, double fRedemp, sal_Int32 nFreq, const ANY& rOB ) THROWDEF_RTE_IAE { - if( fRate < 0 || fPrice <= 0 || CHK_Freq || nMat <= nFirstCoup || nFirstCoup <= nSettle || nSettle <= nIssue ) + if( fRate < 0.0 || fPrice <= 0.0 || CHK_Freq || nMat <= nFirstCoup || nFirstCoup <= nSettle || nSettle <= nIssue ) THROW_IAE; double fRet = GetOddfyield( GetNullDate( xOpt ), nSettle, nMat, nIssue, nFirstCoup, fRate, fPrice, fRedemp, nFreq, @@ -426,7 +426,7 @@ double SAL_CALL AnalysisAddIn::getOddlprice( constREFXPS& xOpt, sal_Int32 nSettle, sal_Int32 nMat, sal_Int32 nLastInterest, double fRate, double fYield, double fRedemp, sal_Int32 nFreq, const ANY& rOB ) THROWDEF_RTE_IAE { - if( fRate < 0 || fYield < 0 || CHK_Freq || nMat <= nSettle || nSettle <= nLastInterest ) + if( fRate < 0.0 || fYield < 0.0 || CHK_Freq || nMat <= nSettle || nSettle <= nLastInterest ) THROW_IAE; double fRet = GetOddlprice( GetNullDate( xOpt ), nSettle, nMat, nLastInterest, fRate, fYield, fRedemp, nFreq, @@ -439,7 +439,7 @@ double SAL_CALL AnalysisAddIn::getOddlyield( constREFXPS& xOpt, sal_Int32 nSettle, sal_Int32 nMat, sal_Int32 nLastInterest, double fRate, double fPrice, double fRedemp, sal_Int32 nFreq, const ANY& rOB ) THROWDEF_RTE_IAE { - if( fRate < 0 || fPrice <= 0 || CHK_Freq || nMat <= nSettle || nSettle <= nLastInterest ) + if( fRate < 0.0 || fPrice <= 0.0 || CHK_Freq || nMat <= nSettle || nSettle <= nLastInterest ) THROW_IAE; double fRet = GetOddlyield( GetNullDate( xOpt ), nSettle, nMat, nLastInterest, fRate, fPrice, fRedemp, nFreq, @@ -455,7 +455,7 @@ double SAL_CALL AnalysisAddIn::getOddlyield( constREFXPS& xOpt, #define D_(i) (*rDates.Get(i)) /** Calculates the resulting amount for the passed interest rate and the given XIRR parameters. */ -double lcl_sca_XirrResult( const ScaDoubleList& rValues, const ScaDoubleList& rDates, double fRate ) +static double lcl_sca_XirrResult( const ScaDoubleList& rValues, const ScaDoubleList& rDates, double fRate ) { /* V_0 ... V_n = input values. D_0 ... D_n = input dates. @@ -477,7 +477,7 @@ double lcl_sca_XirrResult( const ScaDoubleList& rValues, const ScaDoubleList& rD } /** Calculates the first derivation of lcl_sca_XirrResult(). */ -double lcl_sca_XirrResult_Deriv1( const ScaDoubleList& rValues, const ScaDoubleList& rDates, double fRate ) +static double lcl_sca_XirrResult_Deriv1( const ScaDoubleList& rValues, const ScaDoubleList& rDates, double fRate ) { /* V_0 ... V_n = input values. D_0 ... D_n = input dates. |