LibreOffice Module tools (master) 1
|
#include <bigint.hxx>
Public Member Functions | |
BigInt () | |
BigInt (sal_Int32 nValue) | |
BigInt (double nVal) | |
BigInt (sal_uInt32 nVal) | |
BigInt (sal_Int64 nVal) | |
BigInt (const BigInt &rBigInt) | |
BigInt (std::u16string_view rString) | |
operator sal_Int16 () const | |
operator sal_uInt16 () const | |
operator sal_Int32 () const | |
operator sal_uInt32 () const | |
operator double () const | |
bool | IsNeg () const |
bool | IsZero () const |
bool | IsLong () const |
void | Abs () |
BigInt & | operator= (const BigInt &rVal) |
BigInt & | operator+= (const BigInt &rVal) |
BigInt & | operator-= (const BigInt &rVal) |
BigInt & | operator*= (const BigInt &rVal) |
BigInt & | operator/= (const BigInt &rVal) |
BigInt & | operator%= (const BigInt &rVal) |
BigInt & | operator= (sal_Int32 nValue) |
Static Public Member Functions | |
static tools::Long | Scale (tools::Long nVal, tools::Long nMult, tools::Long nDiv) |
Private Member Functions | |
TOOLS_DLLPRIVATE void | MakeBigInt (BigInt const &) |
TOOLS_DLLPRIVATE void | Normalize () |
TOOLS_DLLPRIVATE void | Mult (BigInt const &, sal_uInt16) |
TOOLS_DLLPRIVATE void | Div (sal_uInt16, sal_uInt16 &) |
TOOLS_DLLPRIVATE bool | IsLess (BigInt const &) const |
TOOLS_DLLPRIVATE void | AddLong (BigInt &, BigInt &) |
TOOLS_DLLPRIVATE void | SubLong (BigInt &, BigInt &) |
TOOLS_DLLPRIVATE void | MultLong (BigInt const &, BigInt &) const |
TOOLS_DLLPRIVATE void | DivLong (BigInt const &, BigInt &) const |
TOOLS_DLLPRIVATE void | ModLong (BigInt const &, BigInt &) const |
TOOLS_DLLPRIVATE bool | ABS_IsLess (BigInt const &) const |
Private Attributes | |
union { | |
sal_Int32 nVal | |
sal_uInt16 nNum [MAX_DIGITS] | |
}; | |
sal_uInt8 | nLen: 5 |
bool | bIsNeg: 1 |
Friends | |
class | Fraction |
BigInt | operator+ (const BigInt &rVal1, const BigInt &rVal2) |
BigInt | operator- (const BigInt &rVal1, const BigInt &rVal2) |
BigInt | operator* (const BigInt &rVal1, const BigInt &rVal2) |
BigInt | operator/ (const BigInt &rVal1, const BigInt &rVal2) |
BigInt | operator% (const BigInt &rVal1, const BigInt &rVal2) |
TOOLS_DLLPUBLIC friend bool | operator== (const BigInt &rVal1, const BigInt &rVal2) |
bool | operator!= (const BigInt &rVal1, const BigInt &rVal2) |
TOOLS_DLLPUBLIC friend bool | operator< (const BigInt &rVal1, const BigInt &rVal2) |
bool | operator> (const BigInt &rVal1, const BigInt &rVal2) |
bool | operator<= (const BigInt &rVal1, const BigInt &rVal2) |
bool | operator>= (const BigInt &rVal1, const BigInt &rVal2) |
Definition at line 28 of file bigint.hxx.
|
inline |
Definition at line 52 of file bigint.hxx.
Referenced by operator%=(), and operator/=().
|
inline |
Definition at line 59 of file bigint.hxx.
References nValue.
BigInt::BigInt | ( | double | nVal | ) |
Definition at line 508 of file bigint.cxx.
References bIsNeg, i, MAX_DIGITS, nLen, nNum, Normalize(), nVal, and nValue.
BigInt::BigInt | ( | sal_uInt32 | nVal | ) |
BigInt::BigInt | ( | sal_Int64 | nVal | ) |
Definition at line 565 of file bigint.cxx.
References bIsNeg, i, nLen, nNum, nVal, nValue, SAL_MAX_INT32, and SAL_MIN_INT32.
BigInt::BigInt | ( | const BigInt & | rBigInt | ) |
Definition at line 468 of file bigint.cxx.
BigInt::BigInt | ( | std::u16string_view | rString | ) |
|
inline |
Definition at line 191 of file bigint.hxx.
|
private |
Definition at line 438 of file bigint.cxx.
References i, MakeBigInt(), nLen, nNum, and nVal.
Referenced by operator%=(), and operator/=().
Definition at line 156 of file bigint.cxx.
References bIsNeg, i, nLen, nNum, and SubLong().
Referenced by operator+=(), and SubLong().
|
private |
Definition at line 127 of file bigint.cxx.
Referenced by ModLong(), operator%=(), and operator/=().
Definition at line 307 of file bigint.cxx.
References bIsNeg, i, Mult(), nLen, and nNum.
Referenced by operator/=().
|
private |
|
inline |
Definition at line 92 of file bigint.hxx.
|
inline |
|
inline |
Definition at line 183 of file bigint.hxx.
|
private |
Definition at line 42 of file bigint.cxx.
References bIsNeg, nLen, nNum, and nVal.
Referenced by ABS_IsLess(), operator%=(), operator*=(), operator+=(), operator-=(), and operator/=().
Definition at line 373 of file bigint.cxx.
References Div(), i, Mult(), nLen, and nNum.
Referenced by operator%=().
|
private |
Definition at line 283 of file bigint.cxx.
References bIsNeg, i, nLen, and nNum.
Referenced by operator*=().
|
private |
Definition at line 74 of file bigint.cxx.
References bIsNeg, nLen, nNum, and nVal.
Referenced by BigInt(), operator%=(), operator*=(), operator+=(), operator-=(), and operator/=().
BigInt::operator double | ( | ) | const |
Definition at line 587 of file bigint.cxx.
References i.
|
inline |
Definition at line 124 of file bigint.hxx.
References SAL_MAX_INT16, and SAL_MIN_INT16.
|
inline |
Definition at line 140 of file bigint.hxx.
|
inline |
Definition at line 132 of file bigint.hxx.
References SAL_MAX_UINT16.
|
inline |
Definition at line 148 of file bigint.hxx.
Definition at line 759 of file bigint.cxx.
References ABS_IsLess(), BigInt(), bIsNeg, Div(), MakeBigInt(), ModLong(), nLen, Normalize(), and nVal.
Definition at line 677 of file bigint.cxx.
References MakeBigInt(), MultLong(), nLen, Normalize(), and nVal.
Definition at line 625 of file bigint.cxx.
References AddLong(), MakeBigInt(), MY_MAXLONG, MY_MINLONG, nLen, Normalize(), and nVal.
Definition at line 651 of file bigint.cxx.
References MakeBigInt(), MY_MAXLONG, MY_MINLONG, nLen, Normalize(), nVal, and SubLong().
Definition at line 700 of file bigint.cxx.
References ABS_IsLess(), BigInt(), bIsNeg, Div(), DivLong(), MakeBigInt(), nLen, Normalize(), and nVal.
Definition at line 610 of file bigint.cxx.
|
inline |
Definition at line 167 of file bigint.hxx.
|
static |
Definition at line 836 of file bigint.cxx.
Definition at line 214 of file bigint.cxx.
References AddLong(), bIsNeg, i, IsLess(), nLen, and nNum.
Referenced by AddLong(), and operator-=().
|
friend |
Definition at line 121 of file bigint.hxx.
Definition at line 234 of file bigint.hxx.
Definition at line 227 of file bigint.hxx.
Definition at line 213 of file bigint.hxx.
Definition at line 199 of file bigint.hxx.
Definition at line 206 of file bigint.hxx.
Definition at line 220 of file bigint.hxx.
|
friend |
Definition at line 818 of file bigint.cxx.
Definition at line 241 of file bigint.hxx.
|
friend |
Definition at line 806 of file bigint.cxx.
Definition at line 239 of file bigint.hxx.
Definition at line 246 of file bigint.hxx.
union { ... } BigInt::@2 |
|
private |
Definition at line 37 of file bigint.hxx.
Referenced by Abs(), AddLong(), BigInt(), DivLong(), IsNeg(), MakeBigInt(), Mult(), MultLong(), Normalize(), operator%=(), operator/=(), and SubLong().
|
private |
Definition at line 36 of file bigint.hxx.
Referenced by Abs(), ABS_IsLess(), AddLong(), BigInt(), Div(), DivLong(), IsLess(), IsNeg(), IsZero(), MakeBigInt(), ModLong(), Mult(), MultLong(), Normalize(), operator%=(), operator*=(), operator+=(), operator-=(), operator/=(), operator=(), and SubLong().
sal_uInt16 BigInt::nNum[MAX_DIGITS] |
Definition at line 34 of file bigint.hxx.
Referenced by ABS_IsLess(), AddLong(), BigInt(), Div(), DivLong(), IsLess(), MakeBigInt(), ModLong(), Mult(), MultLong(), Normalize(), and SubLong().
sal_Int32 BigInt::nVal |
Definition at line 33 of file bigint.hxx.
Referenced by Abs(), ABS_IsLess(), BigInt(), IsNeg(), IsZero(), MakeBigInt(), Normalize(), operator%=(), operator*=(), operator+=(), operator-=(), operator/=(), operator=(), and Scale().