diff options
Diffstat (limited to 'tools')
-rw-r--r-- | tools/source/generic/bigint.cxx | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/tools/source/generic/bigint.cxx b/tools/source/generic/bigint.cxx index cda2be1843d7..6fa9a2c472f0 100644 --- a/tools/source/generic/bigint.cxx +++ b/tools/source/generic/bigint.cxx @@ -330,21 +330,21 @@ void BigInt::DivLong( const BigInt& rB, BigInt& rErg ) const for (j = aTmpA.nLen - 1; j >= nLenB; j--) { // guess divisor - sal_Int32 nTmp = ( (sal_Int32)aTmpA.nNum[j] << 16 ) + aTmpA.nNum[j - 1]; + sal_uInt32 nTmp = ( (sal_uInt32)aTmpA.nNum[j] << 16 ) + aTmpA.nNum[j - 1]; if (aTmpA.nNum[j] == aTmpB.nNum[nLenB1]) nQ = 0xFFFF; else - nQ = (sal_uInt16)(((sal_uInt32)nTmp) / aTmpB.nNum[nLenB1]); + nQ = (sal_uInt16)(nTmp / aTmpB.nNum[nLenB1]); if ( ((sal_uInt32)aTmpB.nNum[nLenB1 - 1] * nQ) > - ((((sal_uInt32)nTmp) - (sal_uInt32)aTmpB.nNum[nLenB1] * nQ) << 16) + aTmpA.nNum[j - 2]) + ((nTmp - (sal_uInt32)aTmpB.nNum[nLenB1] * nQ) << 16) + aTmpA.nNum[j - 2]) nQ--; // Start division nK = 0; for (i = 0; i < nLenB; i++) { - nTmp = (sal_Int32)aTmpA.nNum[j - nLenB + i] - - ((sal_Int32)aTmpB.nNum[i] * nQ) + nTmp = (sal_uInt32)aTmpA.nNum[j - nLenB + i] + - ((sal_uInt32)aTmpB.nNum[i] * nQ) - nK; aTmpA.nNum[j - nLenB + i] = (sal_uInt16)nTmp; nK = (sal_uInt16) (nTmp >> 16); @@ -397,21 +397,21 @@ void BigInt::ModLong( const BigInt& rB, BigInt& rErg ) const for (j = aTmpA.nLen - 1; j >= nLenB; j--) { // Guess divisor - sal_Int32 nTmp = ( (sal_Int32)aTmpA.nNum[j] << 16 ) + aTmpA.nNum[j - 1]; + sal_uInt32 nTmp = ( (sal_uInt32)aTmpA.nNum[j] << 16 ) + aTmpA.nNum[j - 1]; if (aTmpA.nNum[j] == aTmpB.nNum[nLenB1]) nQ = 0xFFFF; else - nQ = (sal_uInt16)(((sal_uInt32)nTmp) / aTmpB.nNum[nLenB1]); + nQ = (sal_uInt16)(nTmp / aTmpB.nNum[nLenB1]); if ( ((sal_uInt32)aTmpB.nNum[nLenB1 - 1] * nQ) > - ((((sal_uInt32)nTmp) - aTmpB.nNum[nLenB1] * nQ) << 16) + aTmpA.nNum[j - 2]) + ((nTmp - aTmpB.nNum[nLenB1] * nQ) << 16) + aTmpA.nNum[j - 2]) nQ--; // Start division nK = 0; for (i = 0; i < nLenB; i++) { - nTmp = (sal_Int32)aTmpA.nNum[j - nLenB + i] - - ((sal_Int32)aTmpB.nNum[i] * nQ) + nTmp = (sal_uInt32)aTmpA.nNum[j - nLenB + i] + - ((sal_uInt32)aTmpB.nNum[i] * nQ) - nK; aTmpA.nNum[j - nLenB + i] = (sal_uInt16)nTmp; nK = (sal_uInt16) (nTmp >> 16); |