diff options
author | Laurent Balland-Poirier <laurent.balland-poirier@laposte.net> | 2016-09-22 22:34:15 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2016-09-23 06:53:37 +0000 |
commit | 792da744f3a360b2336fde3c9796e8e22db61308 (patch) | |
tree | f07896ea22bd4316f8a1d3803bd318a40edc86ac /svl | |
parent | b74d2433c856d6d172d9588f4b6d59c31ec02853 (diff) |
Fix Cppcheck report: reduce scope of the variable 'fTemp'
Change-Id: I935de8e287f94f3219542dfe67f7bb4a05be14da
Reviewed-on: https://gerrit.libreoffice.org/29200
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'svl')
-rw-r--r-- | svl/source/numbers/zformat.cxx | 4 |
1 files changed, 2 insertions, 2 deletions
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; |