A 128-bit integer class.
More...
#include <LSSTD128BitInteger.h>
List of all members.
Public Member Functions |
LSE_CALLCTOR | C128BitInteger (const C128BitInteger &_biOp) |
LSE_CALLCTOR | C128BitInteger (LSINT64 _i64Src) |
LSE_CALLCTOR | C128BitInteger (LSUINT64 _ui64Src) |
LSE_CALLCTOR | C128BitInteger (const LSUINT32 *_pui32Src) |
C128BitInteger LSE_CALL | operator- () const |
C128BitInteger LSE_CALL | operator+ (const C128BitInteger &_biOp) const |
C128BitInteger LSE_CALL | operator* (const C128BitInteger &_biOp) const |
C128BitInteger LSE_CALL | operator*= (const C128BitInteger &_biOp) |
C128BitInteger LSE_CALL | operator/ (const C128BitInteger &_biOp) const |
C128BitInteger LSE_CALL | operator/= (const C128BitInteger &_biOp) |
C128BitInteger LSE_CALL | operator% (const C128BitInteger &_biOp) const |
C128BitInteger LSE_CALL | operator- (const C128BitInteger &_biOp) const |
C128BitInteger LSE_CALL | operator<< (LSUINT32 _ui32Shift) const |
C128BitInteger &LSE_CALL | operator<<= (LSUINT32 _ui32Shift) |
C128BitInteger LSE_CALL | operator>> (LSUINT32 _ui32Shift) const |
C128BitInteger &LSE_CALL | operator>>= (LSUINT32 _ui32Shift) |
bool LSE_CALL | operator> (const C128BitInteger &_biOp) const |
bool LSE_CALL | operator< (const C128BitInteger &_biOp) const |
Static Public Member Functions |
static LSVOID LSE_CALL | Negate (const C128BitInteger &_biValue, C128BitInteger &_biResult) |
static LSUINT32 LSE_CALL | ShiftLeft (LSUINT32 *_pui32Data, LSUINT32 _ui32Len, LSUINT32 _ui32Amount) |
static LSUINT32 LSE_CALL | ShiftRight (LSUINT32 *_pui32Data, LSUINT32 _ui32Len, LSUINT32 _ui32Amount) |
static LSVOID LSE_CALL | Add (const C128BitInteger &_biLeft, const C128BitInteger &_biRight, C128BitInteger &_biResult) |
static LSVOID LSE_CALL | Subtract (const C128BitInteger &_biLeft, const C128BitInteger &_biRight, C128BitInteger &_biResult) |
static LSVOID LSE_CALL | Multiply (const C128BitInteger &_biLeft, const C128BitInteger &_biRight, C128BitInteger &_biResult) |
static LSVOID LSE_CALL | Divide (const C128BitInteger &_biLeft, const C128BitInteger &_biRight, C128BitInteger &_biResult) |
static LSVOID LSE_CALL | Modulus (const C128BitInteger &_biLeft, const C128BitInteger &_biRight, C128BitInteger &_biResult) |
Static Protected Member Functions |
static LSVOID LSE_CALL | DivideM (const C128BitInteger &_biLeft, const C128BitInteger &_biRight, C128BitInteger &_biQuotient, C128BitInteger &_biRemainder) |
static LSVOID LSE_CALL | DivideS (const C128BitInteger &_biLeft, const C128BitInteger &_biRight, C128BitInteger &_biQuotient, C128BitInteger &_biRemainder) |
Protected Attributes |
LSUINT32 | m_ui32Digits [4] |
Detailed Description
A 128-bit integer class.
Class C128BitInteger Description: A 128-bit integer class. This is a high-performance 128-bit signed integer class. Use this when you do not need larger values than 128 bits can hold and require performance.
Member Function Documentation
Add two 128-bit integers together and store the result in a third. An exception is thrown on overflow.
- Parameters:
-
_biLeft | Left operand. |
_biRight | Right operand. |
_biResult | Result. |
Divide two 128-bit integers and store the result in a third. An exception is thrown if the right operand is 0.
- Parameters:
-
_biLeft | Left operand. |
_biRight | Right operand. |
_biResult | Result. |
Divide the left operand by the right, storing the result in _biQuotient and _biRemainder. The right operand must have more than one digit, and must not be 0.
- Parameters:
-
_biLeft | Left operand. |
_biRight | Right operand. |
_biQuotient | The quotiant part of the result. |
_biRemainder | The remainder of the result. |
Divide the left operand by the right, storing the result in _biQuotient and _biRemainder. The right operand must have one digit, and must not be 0.
- Parameters:
-
_biLeft | Left operand. |
_biRight | Right operand. |
_biQuotient | The quotiant part of the result. |
_biRemainder | The remainder of the result. |
Obtain the modulus of two 128-bit integers and store the result in a third. An exception is thrown if the right operand is 0.
- Parameters:
-
_biLeft | Left operand. |
_biRight | Right operand. |
_biResult | Result. |
Multiply two 128-bit integers and store the result in a third. An exception is thrown on overflow.
- Parameters:
-
_biLeft | Left operand. |
_biRight | Right operand. |
_biResult | Result. |
Negate a 128-bit integer.
- Parameters:
-
_biValue | The value to negate. |
_biResult | Result. |
Modulus two large integers to create a third large integer holding the result. An exception is thrown if the right operand is 0.
- Parameters:
-
- Returns:
- Returns the result as a new large integer.
Multiply two large integers to create a third 128-bit integer holding the result.
- Parameters:
-
- Returns:
- Returns the result as a new 128-bit integer.
Multiply this large integer by other, assiging the result to this large integer. An exception is thrown on overflow.
- Parameters:
-
- Returns:
- Returns this large integer, which will be filled with the result.
Add two 128-bit integers to create a third 128-bit integer holding the result.
- Parameters:
-
- Returns:
- Returns the result as a new 128-bit integer.
Subtract two large integers to create a third 128-bit integer holding the result. An exception is thrown on overflow.
- Parameters:
-
- Returns:
- Returns the result as a new 128-bit integer.
C128BitInteger LSE_CALL lsstd::C128BitInteger::operator- |
( |
| ) |
const [inline] |
Perform unary negation on this number. The negated value is returned.
- Returns:
- Returns the 2's compliment of this number.
Divide two large integers to create a third large integer holding the result. An exception is thrown if the right operand is 0.
- Parameters:
-
- Returns:
- Returns the result as a new large integer.
Divide this large integer by other, assiging the result to this large integer. An exception is thrown if the right operand is 0.
- Parameters:
-
- Returns:
- Returns this large integer, which will be filled with the result.
bool LSE_CALL lsstd::C128BitInteger::operator< |
( |
const C128BitInteger & |
_biOp | ) |
const [inline] |
Less-than comparison.
- Parameters:
-
- Returns:
- Returns true if this large integer is less than the given large integer.
C128BitInteger LSE_CALL lsstd::C128BitInteger::operator<< |
( |
LSUINT32 |
_ui32Shift | ) |
const [inline] |
Shift bits left by the given amount. The shifted value is returned.
- Parameters:
-
_ui32Shift | The amount by which to shift. |
- Returns:
- Returns the result as a new large integer.
C128BitInteger& LSE_CALL lsstd::C128BitInteger::operator<<= |
( |
LSUINT32 |
_ui32Shift | ) |
[inline] |
Shift bits left by the given amount, storing the result in this instance.
- Parameters:
-
_ui32Shift | The amount by which to shift. |
- Returns:
- Returns the this instance, which holds the result.
bool LSE_CALL lsstd::C128BitInteger::operator> |
( |
const C128BitInteger & |
_biOp | ) |
const [inline] |
Greater-than comparison.
- Parameters:
-
- Returns:
- Returns true if this large integer is greater than the given large integer.
C128BitInteger LSE_CALL lsstd::C128BitInteger::operator>> |
( |
LSUINT32 |
_ui32Shift | ) |
const [inline] |
Shift bits right by the given amount. The shifted value is returned.
- Parameters:
-
_ui32Shift | The amount by which to shift. |
- Returns:
- Returns the result as a new large integer.
C128BitInteger& LSE_CALL lsstd::C128BitInteger::operator>>= |
( |
LSUINT32 |
_ui32Shift | ) |
[inline] |
Shift bits right by the given amount, storing the result in this instance.
- Parameters:
-
_ui32Shift | The amount by which to shift. |
- Returns:
- Returns the this instance, which holds the result.
static LSUINT32 LSE_CALL lsstd::C128BitInteger::ShiftLeft |
( |
LSUINT32 * |
_pui32Data, |
|
|
LSUINT32 |
_ui32Len, |
|
|
LSUINT32 |
_ui32Amount |
|
) |
| [inline, static] |
Shift bits left (up).
- Parameters:
-
_pui32Data | Acts as both the input array of bytes and the output. |
_ui32Len | Length of the buffer. |
_ui32Amount | Amount by which to shift. |
- Returns:
- Returns the number of used digits.
static LSUINT32 LSE_CALL lsstd::C128BitInteger::ShiftRight |
( |
LSUINT32 * |
_pui32Data, |
|
|
LSUINT32 |
_ui32Len, |
|
|
LSUINT32 |
_ui32Amount |
|
) |
| [inline, static] |
Shift bits right (down).
- Parameters:
-
_pui32Data | Acts as both the input array of bytes and the output. |
_ui32Len | Length of the buffer. |
_ui32Amount | Amount by which to shift. |
- Returns:
- Returns the number of used digits.
Subtract two 128-bit integers together and store the result in a third. An exception is thrown on overflow.
- Parameters:
-
_biLeft | Left operand. |
_biRight | Right operand. |
_biResult | Result. |
Member Data Documentation
The 2 32-bit components that compose this 128-bit integer.
The documentation for this class was generated from the following file: