shadow:standard@Number<shadow:standard@BigInteger>, shadow:standard@CanHash
immutable locked class BigInteger
BigInteger objects are immutable representations of arbitrarily large positive and negative integers. They support standard arithmetic operations such as addition, subtraction, multiplication, division, modulus, and comparison.
| Modifiers | Return Types | Method and Description |
|---|---|---|
public |
() |
create(int value)Creates a new |
public |
() |
create(long value)Creates a new |
public |
() |
create(String value)Creates a new |
public |
() |
create(String value, uint base)Creates a new |
public |
() |
create(ulong value)Creates a new |
| Modifiers | Return Types | Method and Description |
|---|---|---|
public |
() |
destroy() |
| Modifiers | Return Types | Method and Description |
|---|---|---|
public readonly locked |
(BigInteger) |
abs()Returns a non-negative version of the object. |
public readonly locked |
(BigInteger) |
add(BigInteger other)Adds another |
public readonly locked |
(BigInteger) |
bitShiftLeft(int amount)Finds the result of left-shifting the bits of the integer value that is represented. |
public readonly locked |
(BigInteger) |
bitShiftRight(int amount)Finds the result of right-shifting the bits of the integer value that is represented. |
public readonly locked |
(int) |
compare(BigInteger other)Compares the current object to another |
public readonly |
(BigInteger) |
copy(AddressMap addresses) |
public readonly locked |
(BigInteger) |
divide(BigInteger other)Divides the current object by another |
public readonly locked |
(boolean) |
equal(BigInteger other)Compares the current object to another |
public readonly locked |
(uint) |
hash()Finds a hash value for the current object. |
public readonly locked |
(BigInteger) |
max(BigInteger other)Finds the maximum of the current object and another |
public readonly locked |
(BigInteger) |
min(BigInteger other)Finds the minimum of the current object and another |
public readonly locked |
(BigInteger) |
modulus(BigInteger other)Divides the current object by another |
public readonly locked |
(BigInteger) |
modulusPower(BigInteger exponent, BigInteger divisor)Raises the current object to the power of another |
public readonly locked |
(BigInteger) |
multiply(BigInteger other)Multiplies the current object by another |
public readonly locked |
(BigInteger) |
negate()Negates the object. |
public readonly locked |
(BigInteger) |
power(BigInteger exponent)Raises the current object to the power of another |
public readonly locked |
(BigInteger) |
subtract(BigInteger other)Subtracts another |
public readonly locked |
(byte) |
toByte()Converts the object to a |
public readonly locked |
(code) |
toCode()Converts the object to a |
public readonly locked |
(double) |
toDouble()Converts the object to a |
public readonly locked |
(float) |
toFloat()Converts the object to a |
public readonly locked |
(int) |
toInt()Converts the object to an |
public readonly locked |
(long) |
toLong()Converts the object to a |
public readonly locked |
(short) |
toShort()Converts the object to a |
public readonly locked |
(String) |
toString()Returns a |
public readonly locked |
(String) |
toString(uint base)Returns a |
public readonly locked |
(ubyte) |
toUByte()Converts the object to a |
public readonly locked |
(uint) |
toUInt()Converts the object to a |
public readonly locked |
(ulong) |
toULong()Converts the object to a |
public readonly locked |
(ushort) |
toUShort()Converts the object to a |
public create(int value) => ()
Creates a new BigInteger with the given int value.
value - value of new object
public create(long value) => ()
Creates a new BigInteger with the given long value.
value - value of new object
public create(String value) => ()
Creates a new BigInteger whose value is represented as text in base 10 by value.
value - String representation of new object
public create(String value, uint base) => ()
Creates a new BigInteger whose value is represented as text in base base by value.
value - String representation of new object
base - base of representation
public create(ulong value) => ()
Creates a new BigInteger with the given ulong value.
value - value of new object
public destroy() => ()
public readonly locked abs() => (BigInteger)
Returns a non-negative version of the object.
non-negative value
public readonly locked add(BigInteger other) => (BigInteger)
Adds another BigInteger to the current object and returns the resulting value.
other - object to add
sum of the two values
public readonly locked bitShiftLeft(int amount) => (BigInteger)
Finds the result of left-shifting the bits of the integer value that is represented.
amount - bits to shift
shifted value
public readonly locked bitShiftRight(int amount) => (BigInteger)
Finds the result of right-shifting the bits of the integer value that is represented.
amount - bits to shift
shifted value
public readonly locked compare(BigInteger other) => (int)
Compares the current object to another BigInteger, returning -1, 0, or 1, if the current object is smaller than, equal to, or larger than the other object, respectively.
other - object to compare to
whether smaller, equal, or larger
public readonly copy(AddressMap addresses) => (BigInteger)
public readonly locked divide(BigInteger other) => (BigInteger)
Divides the current object by another BigInteger and returns the quotient.
other - object to divide by
quotient of the division
public readonly locked equal(BigInteger other) => (boolean)
Compares the current object to another BigInteger, returning true if they represent the same integer.
other - object to compare to
true if identical
public readonly locked hash() => (uint)
Finds a hash value for the current object.
hash value
public readonly locked max(BigInteger other) => (BigInteger)
Finds the maximum of the current object and another BigInteger.
other - object
maximum value
public readonly locked min(BigInteger other) => (BigInteger)
Finds the minimum of the current object and another BigInteger.
other - object
minimum value
public readonly locked modulus(BigInteger other) => (BigInteger)
Divides the current object by another BigInteger and returns the remainder.
other - object to divide by
remainder of the division
public readonly locked modulusPower(BigInteger exponent, BigInteger divisor) => (BigInteger)
Raises the current object to the power of another BigInteger then finds its value modulus a divisor.
exponent - power to raise by
divisor - value to modulo by
number after exponentiation and modulus
public readonly locked multiply(BigInteger other) => (BigInteger)
Multiplies the current object by another BigInteger and returns the resulting value.
other - object to multiply
product of the two values
public readonly locked power(BigInteger exponent) => (BigInteger)
Raises the current object to the power of another BigInteger.
exponent - power to raise by
number after exponentiation
public readonly locked subtract(BigInteger other) => (BigInteger)
Subtracts another BigInteger from the current object and returns the resulting value.
other - object to subtract
difference of the two values
public readonly locked toByte() => (byte)
Converts the object to a byte value, possibly overflowing.
byte value
public readonly locked toCode() => (code)
Converts the object to a code value, possibly overflowing.
code value
public readonly locked toDouble() => (double)
Converts the object to a double value.
double value
public readonly locked toFloat() => (float)
Converts the object to a float value.
float value
public readonly locked toInt() => (int)
Converts the object to an int value, possibly overflowing.
int value
public readonly locked toLong() => (long)
Converts the object to a long value, possibly overflowing.
long value
public readonly locked toShort() => (short)
Converts the object to a short value, possibly overflowing.
short value
public readonly locked toString() => (String)
Returns a String representation of the object, in base 10.
String representation
public readonly locked toString(uint base) => (String)
Returns a String representation of the object, in the specified base.
base - base of output representation
String representation
public readonly locked toUByte() => (ubyte)
Converts the object to a ubyte value, possibly overflowing.
ubyte value
public readonly locked toUInt() => (uint)
Converts the object to a uint value, possibly overflowing.
uint value
public readonly locked toULong() => (ulong)
Converts the object to a ulong value, possibly overflowing.
ulong value
public readonly locked toUShort() => (ushort)
Converts the object to a ushort value, possibly overflowing.
ushort value