Kaydet (Commit) 792da744 authored tarafından Laurent Balland-Poirier's avatar Laurent Balland-Poirier Kaydeden (comit) Noel Grandin

Fix Cppcheck report: reduce scope of the variable 'fTemp'

Change-Id: I935de8e287f94f3219542dfe67f7bb4a05be14da
Reviewed-on: https://gerrit.libreoffice.org/29200Reviewed-by: 's avatarNoel Grandin <noel.grandin@collabora.co.uk>
Tested-by: 's avatarNoel Grandin <noel.grandin@collabora.co.uk>
üst b74d2433
...@@ -2476,13 +2476,13 @@ bool SvNumberformat::ImpGetFractionOutput(double fNumber, ...@@ -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 nBasis = ((sal_uInt64)floor( pow(10.0,rInfo.nCntExp))) - 1; // 9, 99, 999 ,...
sal_uInt64 nFracPrev = 1L, nDivPrev = 0, nFracNext, nDivNext, nPartialDenom; sal_uInt64 nFracPrev = 1L, nDivPrev = 0, nFracNext, nDivNext, nPartialDenom;
double fRemainder = fNumber, fTemp; double fRemainder = fNumber;
// Use continued fraction representation of fNumber // Use continued fraction representation of fNumber
// See https://en.wikipedia.org/wiki/Continued_fraction#Best_rational_approximations // See https://en.wikipedia.org/wiki/Continued_fraction#Best_rational_approximations
while ( fRemainder > 0.0 ) 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 nPartialDenom = (sal_uInt64) floor(fTemp); // due to floating point notation with double precision
fRemainder = fTemp - (double)nPartialDenom; fRemainder = fTemp - (double)nPartialDenom;
nDivNext = nPartialDenom * nDiv + nDivPrev; nDivNext = nPartialDenom * nDiv + nDivPrev;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment