From 792da744f3a360b2336fde3c9796e8e22db61308 Mon Sep 17 00:00:00 2001 From: Laurent Balland-Poirier Date: Thu, 22 Sep 2016 22:34:15 +0200 Subject: Fix Cppcheck report: reduce scope of the variable 'fTemp' Change-Id: I935de8e287f94f3219542dfe67f7bb4a05be14da Reviewed-on: https://gerrit.libreoffice.org/29200 Reviewed-by: Noel Grandin Tested-by: Noel Grandin --- svl/source/numbers/zformat.cxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'svl/source') diff --git a/svl/source/numbers/zformat.cxx b/svl/source/numbers/zformat.cxx index 67f38ee1aa5c..eb0f0484983b 100644 --- a/svl/source/numbers/zformat.cxx +++ b/svl/source/numbers/zformat.cxx @@ -2476,13 +2476,13 @@ bool SvNumberformat::ImpGetFractionOutput(double fNumber, { sal_uInt64 nBasis = ((sal_uInt64)floor( pow(10.0,rInfo.nCntExp))) - 1; // 9, 99, 999 ,... sal_uInt64 nFracPrev = 1L, nDivPrev = 0, nFracNext, nDivNext, nPartialDenom; - double fRemainder = fNumber, fTemp; + double fRemainder = fNumber; // Use continued fraction representation of fNumber // See https://en.wikipedia.org/wiki/Continued_fraction#Best_rational_approximations while ( fRemainder > 0.0 ) { - fTemp = 1.0 / fRemainder; // 64bits precision required when fRemainder is very weak + double fTemp = 1.0 / fRemainder; // 64bits precision required when fRemainder is very weak nPartialDenom = (sal_uInt64) floor(fTemp); // due to floating point notation with double precision fRemainder = fTemp - (double)nPartialDenom; nDivNext = nPartialDenom * nDiv + nDivPrev; -- cgit