summaryrefslogtreecommitdiff
path: root/scaddins/source
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2016-01-27 11:06:10 +0200
committerNoel Grandin <noelgrandin@gmail.com>2016-02-04 06:24:29 +0000
commit318a23b4f4e3e02b664437044de833b9a8e4f85f (patch)
treebbd76fd960f140b66dd46eec3112546ff846bac8 /scaddins/source
parent8ffd2c8dd032e718bc8c3d574cd47e82a2c07261 (diff)
loplugin:fpcomparison in scaddins/
Change-Id: I9a303a92f5531d549faf6d86ea0ce6360e115567 Reviewed-on: https://gerrit.libreoffice.org/21865 Reviewed-by: Noel Grandin <noelgrandin@gmail.com> Tested-by: Noel Grandin <noelgrandin@gmail.com>
Diffstat (limited to 'scaddins/source')
-rw-r--r--scaddins/source/analysis/analysishelper.cxx8
1 files changed, 4 insertions, 4 deletions
diff --git a/scaddins/source/analysis/analysishelper.cxx b/scaddins/source/analysis/analysishelper.cxx
index b820606c399f..b0af04eda3a5 100644
--- a/scaddins/source/analysis/analysishelper.cxx
+++ b/scaddins/source/analysis/analysishelper.cxx
@@ -1123,15 +1123,15 @@ double getYield_( sal_Int32 nNullDate, sal_Int32 nSettle, sal_Int32 nMat, double
double fPrice2 = getPrice_( nNullDate, nSettle, nMat, fRate, fYield2, fRedemp, nFreq, nBase );
double fYieldN = ( fYield2 - fYield1 ) * 0.5;
- for( sal_uInt32 nIter = 0 ; nIter < 100 && fPriceN != fPrice ; nIter++ )
+ for( sal_uInt32 nIter = 0 ; nIter < 100 && !rtl::math::approxEqual(fPriceN, fPrice) ; nIter++ )
{
fPriceN = getPrice_( nNullDate, nSettle, nMat, fRate, fYieldN, fRedemp, nFreq, nBase );
- if( fPrice == fPrice1 )
+ if( rtl::math::approxEqual(fPrice, fPrice1) )
return fYield1;
- else if( fPrice == fPrice2 )
+ else if( rtl::math::approxEqual(fPrice, fPrice2) )
return fYield2;
- else if( fPrice == fPriceN )
+ else if( rtl::math::approxEqual(fPrice, fPriceN) )
return fYieldN;
else if( fPrice < fPrice2 )
{