diff options
Diffstat (limited to 'tools/source/generic/bigint.cxx')
-rw-r--r-- | tools/source/generic/bigint.cxx | 69 |
1 files changed, 0 insertions, 69 deletions
diff --git a/tools/source/generic/bigint.cxx b/tools/source/generic/bigint.cxx index 4392e56d5e44..2312f3c5eeaf 100644 --- a/tools/source/generic/bigint.cxx +++ b/tools/source/generic/bigint.cxx @@ -855,75 +855,6 @@ BigInt& BigInt::operator/=( const BigInt& rVal ) // ----------------------------------------------------------------------- -void BigInt::DivMod( const BigInt& rVal, BigInt& rMod ) -{ - if ( !rVal.bIsBig ) - { - if ( rVal.nVal == 0 ) - { - OSL_FAIL( "BigInt::operator/ --> divide by zero" ); - return; - } - - if ( !bIsBig ) - { - // wir bewegen uns im ungefaehrlichem Bereich - rMod = BigInt( nVal % rVal.nVal ); - nVal /= rVal.nVal; - return; - } - - if ( rVal.nVal == 1 ) - { - rMod = BigInt( (long)0 ); - return; - } - - if ( rVal.nVal == -1 ) - { - rMod = BigInt( (long)0 ); - bIsNeg = !bIsNeg; - return; - } - - if ( rVal.nVal <= (long)0xFFFF && rVal.nVal >= -(long)0xFFFF ) - { - // ein BigInt durch ein sal_uInt16 teilen - sal_uInt16 nTmp; - if ( rVal.nVal < 0 ) - { - nTmp = (sal_uInt16) -rVal.nVal; - bIsNeg = !bIsNeg; - } - else - nTmp = (sal_uInt16) rVal.nVal; - - Div( nTmp, nTmp ); - rMod = BigInt( (long)nTmp ); - Normalize(); - return; - } - } - - if ( ABS_IsLess( rVal ) ) - { - rMod = *this; - *this = BigInt( (long)0 ); - return; - } - - // BigInt durch BigInt teilen - BigInt aTmp1, aTmp2; - aTmp1.MakeBigInt( *this ); - aTmp2.MakeBigInt( rVal ); - aTmp1.DivLong(aTmp2, *this); - Normalize(); - aTmp1.ModLong(aTmp2, rMod); // nicht optimal - rMod.Normalize(); -} - -// ----------------------------------------------------------------------- - BigInt& BigInt::operator%=( const BigInt& rVal ) { if ( !rVal.bIsBig ) |