![]() |
Murl Engine Lua Addon API
Version 1.0 beta
|
An integer of variable capacity.
A predefined big-integer object with value zero.
A predefined big-integer object with value one.
A predefined big-integer object with value two.
Create a big-integer object from a data object. Takes the bytes from the data object:
Murl.Math.BigInteger FromData(Murl.ConstData data)
data | The data object. |
Create a big-integer object from a Hex character string. The sign can be specified by a '+' or '-' prefix character.
Murl.Math.BigInteger FromHexString(String str)
str | The Hex character string. |
The default constructor. The value is set to zero.
Murl.Math.BigInteger new()
Copy constructor taking a signed 64 bit integer.
Murl.Math.BigInteger new(Integer value)
value | The signed integer to copy. |
Copy constructor taking a decimal string. The sign can be specified by a '+' or '-' prefix character.
Murl.Math.BigInteger new(String value)
value | The decimal string to convert. |
Copy constructor with reserved digit count.
Murl.Math.BigInteger new(Murl.Math.BigInteger other, Integer reservedDigits)
reservedDigits | The number of digits to reserve. |
other | The big-integer object to copy. |
Set the value to zero.
Clear()
Copy the value to from a big-integer object.
Set(Murl.Math.BigInteger other)
other | The big-integer object to copy. |
Copy the value to from a big integer object and reserve digits.
Set(Murl.Math.BigInteger other, Integer reservedDigits)
reservedDigits | The number of digits to reserve. |
other | The big-integer object to copy. |
Copy the value to from an signed 32 bit integer.
SetSInt32(Integer value)
value | The signed 32 bit integer to copy. |
Copy the value to from an unsigned 32 bit integer.
SetUInt32(Integer value)
value | The unsigned 32 bit integer to copy. |
Copy the value to from an signed 64 bit integer.
SetSInt64(Integer value)
value | The signed 64 bit integer to copy. |
Copy the value to from an unsigned 64 bit integer.
SetUInt64(Integer value)
value | The unsigned 64 bit integer to copy. |
Convert the value to from a decimal string. The sign can be specified by a '+' or '-' prefix character.
SetString(String value)
value | The decimal string to convert. |
Compare a big-integer object to this.
Integer CompareTo(Murl.Math.BigInteger other)
other | The big-integer object to compare. |
Absolute compare a big-integer object to this.
Integer CompareToAbsolute(Murl.Math.BigInteger other)
other | The big-integer object to compare. |
Get the number of bytes used by the value.
Integer GetLength()
Get a byte from the value at a specified index. Index 0 is the least significant byte.
Integer GetByteAt(Integer index)
index | The index of the byte in range [0 .. GetLength() - 1]. |
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.
Boolean SetByteAt(Integer index, Integer byte)
index | The index of the byte. |
byte | The byte to set. |
Get a bit from the value at a specified index. Index 0 is the least significant bit.
Boolean GetBitAt(Integer index)
index | The index of the bit in range [0 .. GetLength() * 8 - 1]. |
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.
Boolean SetBitAt(Integer index, Boolean bit)
index | The index of the bit. |
bit | The bit to set. |
Check if the value is zero.
Boolean IsZero()
Check if the value is one.
Boolean IsOne()
Check if the value is positive.
Boolean IsPositive()
Check if the value is negative.
Boolean IsNegative()
Check if the value is even.
Boolean IsEven()
Check if the value is odd.
Boolean IsOdd()
Get the inverted value.
Murl.Math.BigInteger Invert()
Get the absolute value.
Murl.Math.BigInteger Abs()
Add this and a big-integer object.
Murl.Math.BigInteger Add(Murl.Math.BigInteger other)
other | The big-integer object to add. |
Subtract this and a big-integer object.
Murl.Math.BigInteger Subtract(Murl.Math.BigInteger other)
other | The big-integer object to subtract. |
Multiply this by a big-integer object.
Murl.Math.BigInteger Multiply(Murl.Math.BigInteger other)
other | The big-integer object to multiply. |
Multiply this by a big-integer object.
Murl.Math.BigInteger Multiply(Murl.Math.BigInteger other, Murl.Math.BigInteger result)
other | The big-integer object to multiply. |
result | The multiplied big-integer object. |
Divide this by a big-integer object.
Murl.Math.BigInteger Divide(Murl.Math.BigInteger other)
other | The big-integer object to divide. |
Divide this by a big-integer object.
Murl.Math.BigInteger, Murl.Math.BigInteger Divide(Murl.Math.BigInteger other, Murl.Math.BigInteger remainder)
other | The big-integer object to divide. |
remainder | The remainder return value. |
Divide this by a big-integer object and return the remainder.
Murl.Math.BigInteger Modulo(Murl.Math.BigInteger other)
other | The big-integer object to divide. |
Get this raised to the power of an integer exponent.
Murl.Math.BigInteger Power(Integer n)
n | The integer exponent. |
Get this raised to the power of a big-integer exponent.
Murl.Math.BigInteger Power(Murl.Math.BigInteger n)
n | The big-integer exponent. |
Divide this raised to the power of a big-integer exponent by a big-integer object and return the remainder.
Murl.Math.BigInteger PowerModulo(Murl.Math.BigInteger n, Murl.Math.BigInteger m)
n | The big-integer exponent. |
m | The big-integer object to divide. |
Get the greatest common divisor of this.
Murl.Math.BigInteger GreatestCommonDivisor(Murl.Math.BigInteger other)
other | The big-integer object to divide. |
Invert the big-integer value.
InvertSelf()
Make the big-integer value absolute.
AbsSelf()
Move left the bytes of the value.
MoveBytesLeftSelf(Integer bytes)
bytes | The number of bytes to move. |
Move right the bytes of the value.
MoveBytesRightSelf(Integer bytes)
bytes | The number of bytes to move. |
Add a big-integer object to this.
AddSelf(Murl.Math.BigInteger other)
other | The big-integer object to add. |
Subtract a big-integer object to this.
SubtractSelf(Murl.Math.BigInteger other)
other | The big-integer object to subtract. |
Multiply this by a big-integer object.
MultiplySelf(Murl.Math.BigInteger other)
other | The big-integer object to multiply. |
Divide this by a big-integer object.
DivideSelf(Murl.Math.BigInteger other)
other | The big-integer object to divide. |
Divide this by a big-integer object.
Murl.Math.BigInteger DivideSelf(Murl.Math.BigInteger other, Murl.Math.BigInteger remainder)
other | The big-integer object to divide. |
remainder | The remainder return value. |
Divide this by a big-integer object and store the remainder.
ModuloSelf(Murl.Math.BigInteger other)
other | The big-integer object to divide. |
Raise this to the power of an integer exponent.
PowerSelf(Integer n)
n | The integer exponent. |
Raise this to the power of a big-integer exponent.
PowerSelf(Murl.Math.BigInteger n)
n | The big-integer exponent. |
Divide this raised to the power of a big-integer exponent by a big-integer object and store the remainder.
PowerModuloSelf(Murl.Math.BigInteger n, Murl.Math.BigInteger m)
n | The big-integer exponent. |
m | The big-integer object to divide. |
Get the Hex character string of the value.
String ToHexString()
Get the data object of the value. Stores the value bytes to a data object:
Murl.Data ToData(Integer length)
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. |
Get the 32 bit unsigned integer value.
Integer ToUInt32(Integer start, Integer count)
start | The index of the byte to start in range [0 .. GetLength() - 1]. |
count | The number of bytes to get. |
Get the 64 bit unsigned integer value.
Integer ToUInt64(Integer start, Integer count)
start | The index of the byte to start in range [0 .. GetLength() - 1]. |
count | The number of bytes to get. |
Equal to comparison operator.
Less than operator.
Less than or equal to operator.
Addition operator.
Unary minus operator.
Subtraction operator.
Multiplication operator.
Division operator.
Modulo operator.