An integer of variable capacity. More...
#include "murl_math_big_integer.h"
Public Member Functions | |
BigInteger () | |
The default constructor. More... | |
BigInteger (const BigInteger &other, UInt32 reservedDigits) | |
Copy constructor with reserved digit count. More... | |
BigInteger (UInt32 value) | |
Copy constructor taking an unsigned 32 bit integer. More... | |
BigInteger (SInt32 value) | |
Copy constructor taking a signed 32 bit integer. More... | |
BigInteger (UInt64 value) | |
Copy constructor taking an unsigned 64 bit integer. More... | |
BigInteger (SInt64 value) | |
Copy constructor taking a signed 64 bit integer. More... | |
BigInteger (const String &value) | |
Copy constructor taking a decimal string. More... | |
void | Clear () |
Set the value to zero. | |
void | Set (const BigInteger &other) |
Copy the value to from a big-integer object. More... | |
void | Set (const BigInteger &other, UInt32 reservedDigits) |
Copy the value to from a big integer object and reserve digits. More... | |
void | SetSInt32 (SInt32 value) |
Copy the value to from an signed 32 bit integer. More... | |
void | SetUInt32 (UInt32 value) |
Copy the value to from an unsigned 32 bit integer. More... | |
void | SetSInt64 (SInt64 value) |
Copy the value to from an signed 64 bit integer. More... | |
void | SetUInt64 (UInt64 value) |
Copy the value to from an unsigned 64 bit integer. More... | |
void | SetString (const String &value) |
Convert the value to from a decimal string. More... | |
SInt32 | CompareTo (const BigInteger &other) const |
Compare a big-integer object to this. More... | |
SInt32 | CompareToAbsolute (const BigInteger &other) const |
Absolute compare a big-integer object to this. More... | |
UInt32 | GetLength () const |
Get the number of bytes used by the value. More... | |
UInt8 | GetByteAt (UInt32 index) const |
Get a byte from the value at a specified index. More... | |
Bool | SetByteAt (UInt32 index, UInt8 byte) |
Set a byte of the value at a specified index. More... | |
Bool | GetBitAt (UInt32 index) const |
Get a bit from the value at a specified index. More... | |
Bool | SetBitAt (UInt32 index, Bool bit) |
Set a bit of the value at a specified index. More... | |
Bool | IsZero () const |
Check if the value is zero. More... | |
Bool | IsOne () const |
Check if the value is one. More... | |
Bool | IsPositive () const |
Check if the value is positive. More... | |
Bool | IsNegative () const |
Check if the value is negative. More... | |
Bool | IsEven () const |
Check if the value is even. More... | |
Bool | IsOdd () const |
Check if the value is odd. More... | |
BigInteger | Invert () const |
Get the inverted value. More... | |
BigInteger | Abs () const |
Get the absolute value. More... | |
BigInteger | Add (const BigInteger &other) const |
Add this and a big-integer object. More... | |
BigInteger | Subtract (const BigInteger &other) const |
Subtract this and a big-integer object. More... | |
BigInteger | Multiply (const BigInteger &other) const |
Multiply this by a big-integer object. More... | |
BigInteger | Divide (const BigInteger &other) const |
Divide this by a big-integer object. More... | |
BigInteger | Divide (const BigInteger &other, BigInteger &remainder) const |
Divide this by a big-integer object. More... | |
BigInteger | Modulo (const BigInteger &other) const |
Divide this by a big-integer object and return the remainder. More... | |
BigInteger | Power (UInt32 n) const |
Get this raised to the power of an integer exponent. More... | |
BigInteger | Power (const BigInteger &n) const |
Get this raised to the power of a big-integer exponent. More... | |
BigInteger | PowerModulo (const BigInteger &n, const BigInteger &m) const |
Divide this raised to the power of a big-integer exponent by a big-integer object and return the remainder. More... | |
void | Multiply (const BigInteger &other, BigInteger &result) const |
Multiply this by a big-integer object. More... | |
BigInteger | GreatestCommonDivisor (const BigInteger &other) const |
Get the greatest common divisor of this. More... | |
void | InvertSelf () |
Invert the big-integer value. | |
void | AbsSelf () |
Make the big-integer value absolute. | |
void | MoveBytesLeftSelf (UInt32 bytes) |
Move left the bytes of the value. More... | |
void | MoveBytesRightSelf (UInt32 bytes) |
Move right the bytes of the value. More... | |
void | AddSelf (const BigInteger &other) |
Add a big-integer object to this. More... | |
void | SubtractSelf (const BigInteger &other) |
Subtract a big-integer object to this. More... | |
void | MultiplySelf (const BigInteger &other) |
Multiply this by a big-integer object. More... | |
void | DivideSelf (const BigInteger &other) |
Divide this by a big-integer object. More... | |
void | DivideSelf (const BigInteger &other, BigInteger &remainder) |
Divide this by a big-integer object. More... | |
void | ModuloSelf (const BigInteger &other) |
Divide this by a big-integer object and store the remainder. More... | |
void | PowerSelf (UInt32 n) |
Raise this to the power of an integer exponent. More... | |
void | PowerSelf (const BigInteger &n) |
Raise this to the power of a big-integer exponent. More... | |
void | PowerModuloSelf (const BigInteger &n, const BigInteger &m) |
Divide this raised to the power of a big-integer exponent by a big-integer object and store the remainder. More... | |
String | ToHexString () const |
Get the Hex character string of the value. More... | |
Data | ToData (UInt32 length=0) const |
Get the data object of the value. More... | |
UInt32 | ToUInt32 (UInt32 start, UInt32 count) const |
Get the 32 bit unsigned integer value. More... | |
UInt64 | ToUInt64 (UInt32 start, UInt32 count) const |
Get the 64 bit unsigned integer value. More... | |
bool | operator== (const BigInteger &rhs) const |
Equal to comparison operator. More... | |
bool | operator!= (const BigInteger &rhs) const |
Not equal to comparison operator. More... | |
bool | operator< (const BigInteger &rhs) const |
Less than operator. More... | |
bool | operator> (const BigInteger &rhs) const |
Greater than operator. More... | |
bool | operator<= (const BigInteger &rhs) const |
Less than or equal to operator. More... | |
bool | operator>= (const BigInteger &rhs) const |
Greater than or equal to operator. More... | |
BigInteger & | operator= (const BigInteger &value) |
Assignment operator for big-integer object. More... | |
BigInteger & | operator= (SInt32 value) |
Assignment operator for signed 32 bit integer. More... | |
BigInteger & | operator= (UInt32 value) |
Assignment operator for unsigned 32 bit integer. More... | |
BigInteger & | operator= (SInt64 value) |
Assignment operator for signed 64 bit integer. More... | |
BigInteger & | operator= (UInt64 value) |
Assignment operator for unsigned 64 bit integer. More... | |
BigInteger & | operator= (const String &value) |
Assignment operator for decimal string. More... | |
BigInteger | operator+ () const |
Unary plus operator. More... | |
BigInteger | operator- () const |
Unary minus operator. More... | |
BigInteger & | operator++ () |
Increment prefix operator. More... | |
BigInteger | operator++ (SInt32) |
Increment suffix operator. More... | |
BigInteger & | operator-- () |
Decrement prefix operator. More... | |
BigInteger | operator-- (SInt32) |
Decrement suffix operator. More... | |
BigInteger | operator<< (UInt32 bits) const |
Bitwise left shift operator. More... | |
BigInteger | operator>> (UInt32 bits) const |
Bitwise right shift operator. More... | |
BigInteger | operator+ (const BigInteger &rhs) const |
Addition operator. More... | |
BigInteger | operator- (const BigInteger &rhs) const |
Subtraction operator. More... | |
BigInteger | operator* (const BigInteger &rhs) const |
Multiplication operator. More... | |
BigInteger | operator/ (const BigInteger &rhs) const |
Division operator. More... | |
BigInteger | operator% (const BigInteger &rhs) const |
Modulo operator. More... | |
BigInteger & | operator<<= (UInt32 bits) |
In-place bitwise left shift operator. More... | |
BigInteger & | operator>>= (UInt32 bits) |
In-place bitwise right shift operator. More... | |
BigInteger & | operator+= (const BigInteger &other) |
In-place addition operator. More... | |
BigInteger & | operator-= (const BigInteger &other) |
In-place subtraction operator. More... | |
BigInteger & | operator*= (const BigInteger &other) |
In-place multiplication operator. More... | |
BigInteger & | operator/= (const BigInteger &other) |
In-place division operator. More... | |
BigInteger & | operator%= (const BigInteger &other) |
In-place modulo operator. More... | |
Static Public Member Functions | |
static BigInteger | FromData (const ConstData &data) |
Create a big-integer object from a data object. More... | |
static BigInteger | FromData (const UInt8 *data, UInt32 byteSize) |
Create a big-integer object from a memory location. More... | |
static BigInteger | FromHexString (const String &str) |
Create a big-integer object from a Hex character string. More... | |
Static Public Attributes | |
static const BigInteger | ZERO |
A predefined big-integer object with value zero. | |
static const BigInteger | ONE |
A predefined big-integer object with value one. | |
static const BigInteger | TWO |
A predefined big-integer object with value two. | |
Detailed Description
An integer of variable capacity.
Constructor & Destructor Documentation
◆ BigInteger() [1/7]
Murl::Math::BigInteger::BigInteger | ( | ) |
The default constructor.
The value is set to zero.
◆ BigInteger() [2/7]
Murl::Math::BigInteger::BigInteger | ( | const BigInteger & | other, |
UInt32 | reservedDigits | ||
) |
Copy constructor with reserved digit count.
- Parameters
-
reservedDigits The number of digits to reserve. other The big-integer object to copy.
◆ BigInteger() [3/7]
Murl::Math::BigInteger::BigInteger | ( | UInt32 | value | ) |
Copy constructor taking an unsigned 32 bit integer.
- Parameters
-
value The unsigned integer to copy.
◆ BigInteger() [4/7]
Murl::Math::BigInteger::BigInteger | ( | SInt32 | value | ) |
Copy constructor taking a signed 32 bit integer.
- Parameters
-
value The signed integer to copy.
◆ BigInteger() [5/7]
Murl::Math::BigInteger::BigInteger | ( | UInt64 | value | ) |
Copy constructor taking an unsigned 64 bit integer.
- Parameters
-
value The unsigned integer to copy.
◆ BigInteger() [6/7]
Murl::Math::BigInteger::BigInteger | ( | SInt64 | value | ) |
Copy constructor taking a signed 64 bit integer.
- Parameters
-
value The signed integer to copy.
◆ BigInteger() [7/7]
Murl::Math::BigInteger::BigInteger | ( | const String & | value | ) |
Copy constructor taking a decimal string.
The sign can be specified by a '+' or '-' prefix character.
- Parameters
-
value The decimal string to convert.
Member Function Documentation
◆ FromData() [1/2]
|
static |
Create a big-integer object from a data object.
Takes the bytes from the data object:
- The first byte is the most significant byte.
- The last byte is the least significant byte.
- The sign is always positive.
- Parameters
-
data The data object.
- Returns
- The created big-integer object.
◆ FromData() [2/2]
|
static |
Create a big-integer object from a memory location.
Takes the bytes from the memory location:
- The first byte is the most significant byte.
- The last byte is the least significant byte.
- The sign is always positive.
- Parameters
-
data The pointer to the memory location. byteSize The number of bytes to read from the memory location.
- Returns
- The created big-integer object.
◆ FromHexString()
|
static |
Create a big-integer object from a Hex character string.
The sign can be specified by a '+' or '-' prefix character.
- Parameters
-
str The Hex character string.
- Returns
- The created big-integer object.
◆ Set() [1/2]
void Murl::Math::BigInteger::Set | ( | const BigInteger & | other | ) |
Copy the value to from a big-integer object.
- Parameters
-
other The big-integer object to copy.
◆ Set() [2/2]
void Murl::Math::BigInteger::Set | ( | const BigInteger & | other, |
UInt32 | reservedDigits | ||
) |
Copy the value to from a big integer object and reserve digits.
- Parameters
-
reservedDigits The number of digits to reserve. other The big-integer object to copy.
◆ SetSInt32()
void Murl::Math::BigInteger::SetSInt32 | ( | SInt32 | value | ) |
Copy the value to from an signed 32 bit integer.
- Parameters
-
value The signed 32 bit integer to copy.
◆ SetUInt32()
void Murl::Math::BigInteger::SetUInt32 | ( | UInt32 | value | ) |
Copy the value to from an unsigned 32 bit integer.
- Parameters
-
value The unsigned 32 bit integer to copy.
◆ SetSInt64()
void Murl::Math::BigInteger::SetSInt64 | ( | SInt64 | value | ) |
Copy the value to from an signed 64 bit integer.
- Parameters
-
value The signed 64 bit integer to copy.
◆ SetUInt64()
void Murl::Math::BigInteger::SetUInt64 | ( | UInt64 | value | ) |
Copy the value to from an unsigned 64 bit integer.
- Parameters
-
value The unsigned 64 bit integer to copy.
◆ SetString()
void Murl::Math::BigInteger::SetString | ( | const String & | value | ) |
Convert the value to from a decimal string.
The sign can be specified by a '+' or '-' prefix character.
- Parameters
-
value The decimal string to convert.
◆ CompareTo()
SInt32 Murl::Math::BigInteger::CompareTo | ( | const BigInteger & | other | ) | const |
Compare a big-integer object to this.
- Parameters
-
other The big-integer object to compare.
- Returns
- 0 if equal, -1 if this is lesser than the other or 1 this is greater than the other.
◆ CompareToAbsolute()
SInt32 Murl::Math::BigInteger::CompareToAbsolute | ( | const BigInteger & | other | ) | const |
Absolute compare a big-integer object to this.
- Parameters
-
other The big-integer object to compare.
- Returns
- 0 if equal, -1 if this is lesser than the other or 1 this is greater than the other.
◆ GetLength()
UInt32 Murl::Math::BigInteger::GetLength | ( | ) | const |
Get the number of bytes used by the value.
- Returns
- The number of bytes used by the value.
◆ GetByteAt()
Get a byte from the value at a specified index.
Index 0 is the least significant byte.
- Parameters
-
index The index of the byte in range [0 .. GetLength() - 1].
- Returns
- The byte from the value at the specified index or zero if the index is out of range.
◆ SetByteAt()
Set a byte of the value at a specified index.
The value is expanded if the index is out of range. Index 0 is the least significant byte.
- Parameters
-
index The index of the byte. byte The byte to set.
- Returns
- true if successful.
◆ GetBitAt()
Get a bit from the value at a specified index.
Index 0 is the least significant bit.
- Parameters
-
index The index of the bit in range [0 .. GetLength() * 8 - 1].
- Returns
- The bit from the value at the specified index or false if the index is out of range.
◆ SetBitAt()
Set a bit of the value at a specified index.
The value is expanded if the index is out of range. Index 0 is the least significant bit.
- Parameters
-
index The index of the bit. bit The bit to set.
- Returns
- true if successful.
◆ IsZero()
Bool Murl::Math::BigInteger::IsZero | ( | ) | const |
Check if the value is zero.
- Returns
- true if the value is zero.
◆ IsOne()
Bool Murl::Math::BigInteger::IsOne | ( | ) | const |
Check if the value is one.
- Returns
- true if the value is one.
◆ IsPositive()
Bool Murl::Math::BigInteger::IsPositive | ( | ) | const |
Check if the value is positive.
- Returns
- true if the value is positive.
◆ IsNegative()
Bool Murl::Math::BigInteger::IsNegative | ( | ) | const |
Check if the value is negative.
- Returns
- true if the value is negative.
◆ IsEven()
Bool Murl::Math::BigInteger::IsEven | ( | ) | const |
Check if the value is even.
- Returns
- true if the value is even.
◆ IsOdd()
Bool Murl::Math::BigInteger::IsOdd | ( | ) | const |
Check if the value is odd.
- Returns
- true if the value is odd.
◆ Invert()
BigInteger Murl::Math::BigInteger::Invert | ( | ) | const |
Get the inverted value.
- Returns
- The inverted big-integer object.
◆ Abs()
BigInteger Murl::Math::BigInteger::Abs | ( | ) | const |
Get the absolute value.
- Returns
- The absolute big-integer object.
◆ Add()
BigInteger Murl::Math::BigInteger::Add | ( | const BigInteger & | other | ) | const |
Add this and a big-integer object.
- Parameters
-
other The big-integer object to add.
- Returns
- The added big-integer object.
◆ Subtract()
BigInteger Murl::Math::BigInteger::Subtract | ( | const BigInteger & | other | ) | const |
Subtract this and a big-integer object.
- Parameters
-
other The big-integer object to subtract.
- Returns
- The subtracted big-integer object.
◆ Multiply() [1/2]
BigInteger Murl::Math::BigInteger::Multiply | ( | const BigInteger & | other | ) | const |
Multiply this by a big-integer object.
- Parameters
-
other The big-integer object to multiply.
- Returns
- The multiplied big-integer object.
◆ Divide() [1/2]
BigInteger Murl::Math::BigInteger::Divide | ( | const BigInteger & | other | ) | const |
Divide this by a big-integer object.
- Parameters
-
other The big-integer object to divide.
- Returns
- The divided big-integer object.
◆ Divide() [2/2]
BigInteger Murl::Math::BigInteger::Divide | ( | const BigInteger & | other, |
BigInteger & | remainder | ||
) | const |
Divide this by a big-integer object.
- Parameters
-
other The big-integer object to divide. remainder The remainder return value.
- Returns
- The divided big-integer object.
◆ Modulo()
BigInteger Murl::Math::BigInteger::Modulo | ( | const BigInteger & | other | ) | const |
Divide this by a big-integer object and return the remainder.
- Parameters
-
other The big-integer object to divide.
- Returns
- The remainder big-integer object.
◆ Power() [1/2]
BigInteger Murl::Math::BigInteger::Power | ( | UInt32 | n | ) | const |
Get this raised to the power of an integer exponent.
- Parameters
-
n The integer exponent.
- Returns
- The exponentiated big-integer object.
◆ Power() [2/2]
BigInteger Murl::Math::BigInteger::Power | ( | const BigInteger & | n | ) | const |
Get this raised to the power of a big-integer exponent.
- Parameters
-
n The big-integer exponent.
- Returns
- The exponentiated big-integer object.
◆ PowerModulo()
BigInteger Murl::Math::BigInteger::PowerModulo | ( | const BigInteger & | n, |
const BigInteger & | m | ||
) | const |
Divide this raised to the power of a big-integer exponent by a big-integer object and return the remainder.
- Parameters
-
n The big-integer exponent. m The big-integer object to divide.
- Returns
- The remainder big-integer object.
◆ Multiply() [2/2]
void Murl::Math::BigInteger::Multiply | ( | const BigInteger & | other, |
BigInteger & | result | ||
) | const |
Multiply this by a big-integer object.
- Parameters
-
other The big-integer object to multiply. result The multiplied big-integer object.
◆ GreatestCommonDivisor()
BigInteger Murl::Math::BigInteger::GreatestCommonDivisor | ( | const BigInteger & | other | ) | const |
Get the greatest common divisor of this.
- Parameters
-
other The big-integer object to divide.
- Returns
- Get the greatest common divisor of this.
◆ MoveBytesLeftSelf()
void Murl::Math::BigInteger::MoveBytesLeftSelf | ( | UInt32 | bytes | ) |
Move left the bytes of the value.
- Parameters
-
bytes The number of bytes to move.
◆ MoveBytesRightSelf()
void Murl::Math::BigInteger::MoveBytesRightSelf | ( | UInt32 | bytes | ) |
Move right the bytes of the value.
- Parameters
-
bytes The number of bytes to move.
◆ AddSelf()
void Murl::Math::BigInteger::AddSelf | ( | const BigInteger & | other | ) |
Add a big-integer object to this.
- Parameters
-
other The big-integer object to add.
◆ SubtractSelf()
void Murl::Math::BigInteger::SubtractSelf | ( | const BigInteger & | other | ) |
Subtract a big-integer object to this.
- Parameters
-
other The big-integer object to subtract.
◆ MultiplySelf()
void Murl::Math::BigInteger::MultiplySelf | ( | const BigInteger & | other | ) |
Multiply this by a big-integer object.
- Parameters
-
other The big-integer object to multiply.
◆ DivideSelf() [1/2]
void Murl::Math::BigInteger::DivideSelf | ( | const BigInteger & | other | ) |
Divide this by a big-integer object.
- Parameters
-
other The big-integer object to divide.
◆ DivideSelf() [2/2]
void Murl::Math::BigInteger::DivideSelf | ( | const BigInteger & | other, |
BigInteger & | remainder | ||
) |
Divide this by a big-integer object.
- Parameters
-
other The big-integer object to divide. remainder The remainder return value.
◆ ModuloSelf()
void Murl::Math::BigInteger::ModuloSelf | ( | const BigInteger & | other | ) |
Divide this by a big-integer object and store the remainder.
- Parameters
-
other The big-integer object to divide.
◆ PowerSelf() [1/2]
void Murl::Math::BigInteger::PowerSelf | ( | UInt32 | n | ) |
Raise this to the power of an integer exponent.
- Parameters
-
n The integer exponent.
◆ PowerSelf() [2/2]
void Murl::Math::BigInteger::PowerSelf | ( | const BigInteger & | n | ) |
Raise this to the power of a big-integer exponent.
- Parameters
-
n The big-integer exponent.
◆ PowerModuloSelf()
void Murl::Math::BigInteger::PowerModuloSelf | ( | const BigInteger & | n, |
const BigInteger & | m | ||
) |
Divide this raised to the power of a big-integer exponent by a big-integer object and store the remainder.
- Parameters
-
n The big-integer exponent. m The big-integer object to divide.
◆ ToHexString()
String Murl::Math::BigInteger::ToHexString | ( | ) | const |
Get the Hex character string of the value.
- Returns
- The Hex character string of the value.
◆ ToData()
Get the data object of the value.
Stores the value bytes to a data object:
- The first byte is the most significant byte.
- The last byte is the least significant byte.
- The sign is not stored.
- Parameters
-
length The number of bytes in the data object. Zero length adjusts the size of the data object to the number of bytes of the value. If the length is too small the most significant bytes are truncated.
- Returns
- The the data object of the value.
◆ ToUInt32()
Get the 32 bit unsigned integer value.
- Parameters
-
start The index of the byte to start in range [0 .. GetLength() - 1]. count The number of bytes to get.
- Returns
- The 32 bit unsigned integer value.
◆ ToUInt64()
Get the 64 bit unsigned integer value.
- Parameters
-
start The index of the byte to start in range [0 .. GetLength() - 1]. count The number of bytes to get.
- Returns
- The 64 bit unsigned integer value.
◆ operator==()
bool Murl::Math::BigInteger::operator== | ( | const BigInteger & | rhs | ) | const |
Equal to comparison operator.
- Parameters
-
rhs The right hand side big-integer object to compare.
- Returns
- true if the value and sign are equal.
◆ operator!=()
bool Murl::Math::BigInteger::operator!= | ( | const BigInteger & | rhs | ) | const |
Not equal to comparison operator.
- Parameters
-
rhs The right hand side big-integer object to compare.
- Returns
- true if the value and sign are not equal.
◆ operator<()
bool Murl::Math::BigInteger::operator< | ( | const BigInteger & | rhs | ) | const |
Less than operator.
- Parameters
-
rhs The right hand side big-integer object to compare.
- Returns
- true if the left hand side (this) is less than the right hand side.
◆ operator>()
bool Murl::Math::BigInteger::operator> | ( | const BigInteger & | rhs | ) | const |
Greater than operator.
- Parameters
-
rhs The right hand side big-integer object to compare.
- Returns
- true if the left hand side (this) is greater than the right hand side.
◆ operator<=()
bool Murl::Math::BigInteger::operator<= | ( | const BigInteger & | rhs | ) | const |
Less than or equal to operator.
- Parameters
-
rhs The right hand side big-integer object to compare.
- Returns
- true if the left hand side (this) is less than or equal to the right hand side.
◆ operator>=()
bool Murl::Math::BigInteger::operator>= | ( | const BigInteger & | rhs | ) | const |
Greater than or equal to operator.
- Parameters
-
rhs The right hand side big-integer object to compare.
- Returns
- true if the left hand side (this) is greater than or equal to the right hand side.
◆ operator=() [1/6]
BigInteger& Murl::Math::BigInteger::operator= | ( | const BigInteger & | value | ) |
Assignment operator for big-integer object.
- Parameters
-
value The value to assign.
- Returns
- The object itself.
◆ operator=() [2/6]
BigInteger& Murl::Math::BigInteger::operator= | ( | SInt32 | value | ) |
Assignment operator for signed 32 bit integer.
- Parameters
-
value The value to assign.
- Returns
- The object itself.
◆ operator=() [3/6]
BigInteger& Murl::Math::BigInteger::operator= | ( | UInt32 | value | ) |
Assignment operator for unsigned 32 bit integer.
- Parameters
-
value The value to assign.
- Returns
- The object itself.
◆ operator=() [4/6]
BigInteger& Murl::Math::BigInteger::operator= | ( | SInt64 | value | ) |
Assignment operator for signed 64 bit integer.
- Parameters
-
value The value to assign.
- Returns
- The object itself.
◆ operator=() [5/6]
BigInteger& Murl::Math::BigInteger::operator= | ( | UInt64 | value | ) |
Assignment operator for unsigned 64 bit integer.
- Parameters
-
value The value to assign.
- Returns
- The object itself.
◆ operator=() [6/6]
BigInteger& Murl::Math::BigInteger::operator= | ( | const String & | value | ) |
Assignment operator for decimal string.
The sign can be specified by a '+' or '-' prefix character.
- Parameters
-
value The value to assign.
- Returns
- The object itself.
◆ operator+() [1/2]
BigInteger Murl::Math::BigInteger::operator+ | ( | ) | const |
Unary plus operator.
- Returns
- A copy of the object.
◆ operator-() [1/2]
BigInteger Murl::Math::BigInteger::operator- | ( | ) | const |
Unary minus operator.
- Returns
- A copy of the inverted object.
◆ operator++() [1/2]
BigInteger& Murl::Math::BigInteger::operator++ | ( | ) |
Increment prefix operator.
- Returns
- The incremented object itself.
◆ operator++() [2/2]
BigInteger Murl::Math::BigInteger::operator++ | ( | SInt32 | ) |
Increment suffix operator.
- Returns
- A copy of the object before incrementation.
◆ operator--() [1/2]
BigInteger& Murl::Math::BigInteger::operator-- | ( | ) |
Decrement prefix operator.
- Returns
- The decremented object itself.
◆ operator--() [2/2]
BigInteger Murl::Math::BigInteger::operator-- | ( | SInt32 | ) |
Decrement suffix operator.
- Returns
- A copy of the object before decrementation.
◆ operator<<()
BigInteger Murl::Math::BigInteger::operator<< | ( | UInt32 | bits | ) | const |
Bitwise left shift operator.
- Parameters
-
bits The number of bits to shift.
- Returns
- The shifted object.
◆ operator>>()
BigInteger Murl::Math::BigInteger::operator>> | ( | UInt32 | bits | ) | const |
Bitwise right shift operator.
- Parameters
-
bits The number of bits to shift.
- Returns
- The shifted object.
◆ operator+() [2/2]
BigInteger Murl::Math::BigInteger::operator+ | ( | const BigInteger & | rhs | ) | const |
Addition operator.
- Parameters
-
rhs The right hand side big-integer object to add.
- Returns
- The added big-integer object.
◆ operator-() [2/2]
BigInteger Murl::Math::BigInteger::operator- | ( | const BigInteger & | rhs | ) | const |
Subtraction operator.
- Parameters
-
rhs The right hand side big-integer object to subtract.
- Returns
- The subtracted big-integer object.
◆ operator*()
BigInteger Murl::Math::BigInteger::operator* | ( | const BigInteger & | rhs | ) | const |
Multiplication operator.
- Parameters
-
rhs The right hand side big-integer object to multiply.
- Returns
- The multiplied big-integer object.
◆ operator/()
BigInteger Murl::Math::BigInteger::operator/ | ( | const BigInteger & | rhs | ) | const |
Division operator.
- Parameters
-
rhs The right hand side big-integer object to divide.
- Returns
- The divided big-integer object.
◆ operator%()
BigInteger Murl::Math::BigInteger::operator% | ( | const BigInteger & | rhs | ) | const |
Modulo operator.
- Parameters
-
rhs The right hand side big-integer object to divide.
- Returns
- The remainder big-integer object.
◆ operator<<=()
BigInteger& Murl::Math::BigInteger::operator<<= | ( | UInt32 | bits | ) |
In-place bitwise left shift operator.
- Parameters
-
bits The number of bits to shift.
- Returns
- The object itself.
◆ operator>>=()
BigInteger& Murl::Math::BigInteger::operator>>= | ( | UInt32 | bits | ) |
In-place bitwise right shift operator.
- Parameters
-
bits The number of bits to shift.
- Returns
- The object itself.
◆ operator+=()
BigInteger& Murl::Math::BigInteger::operator+= | ( | const BigInteger & | other | ) |
In-place addition operator.
- Parameters
-
other The big-integer object to add.
- Returns
- The object itself.
◆ operator-=()
BigInteger& Murl::Math::BigInteger::operator-= | ( | const BigInteger & | other | ) |
In-place subtraction operator.
- Parameters
-
other The big-integer object to subtract.
- Returns
- The object itself.
◆ operator*=()
BigInteger& Murl::Math::BigInteger::operator*= | ( | const BigInteger & | other | ) |
In-place multiplication operator.
- Parameters
-
other The big-integer object to multiply.
- Returns
- The object itself.
◆ operator/=()
BigInteger& Murl::Math::BigInteger::operator/= | ( | const BigInteger & | other | ) |
In-place division operator.
- Parameters
-
other The big-integer object to divide.
- Returns
- The object itself.
◆ operator%=()
BigInteger& Murl::Math::BigInteger::operator%= | ( | const BigInteger & | other | ) |
In-place modulo operator.
- Parameters
-
other The big-integer object to divide.
- Returns
- The object itself.
The documentation for this class was generated from the following file:
- murl_math_big_integer.h