shadow:standard

Class BigInteger

Parent class

shadow:standard@Object

Interfaces

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.

Create Summary

Modifiers Return Types Method and Description
public () create(int value)

Creates a new BigInteger with the given int value.

public () create(long value)

Creates a new BigInteger with the given long value.

public () create(String value)

Creates a new BigInteger whose value is represented as text in base 10 by value.

public () create(String value, uint base)

Creates a new BigInteger whose value is represented as text in base base by value.

public () create(ulong value)

Creates a new BigInteger with the given ulong value.

Destroy Summary

Modifiers Return Types Method and Description
public () destroy()

Method Summary

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 BigInteger to the current object and returns the resulting value.

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 BigInteger, returning -1, 0, or 1, if the current object is smaller than, equal to, or larger than the other object, respectively.

public readonly (BigInteger) copy(AddressMap addresses)
public readonly locked (BigInteger) divide(BigInteger other)

Divides the current object by another BigInteger and returns the quotient.

public readonly locked (boolean) equal(BigInteger other)

Compares the current object to another BigInteger, returning true if they represent the same integer.

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 BigInteger.

public readonly locked (BigInteger) min(BigInteger other)

Finds the minimum of the current object and another BigInteger.

public readonly locked (BigInteger) modulus(BigInteger other)

Divides the current object by another BigInteger and returns the remainder.

public readonly locked (BigInteger) modulusPower(BigInteger exponent, BigInteger divisor)

Raises the current object to the power of another BigInteger then finds its value modulus a divisor.

public readonly locked (BigInteger) multiply(BigInteger other)

Multiplies the current object by another BigInteger and returns the resulting value.

public readonly locked (BigInteger) negate()

Negates the object.

public readonly locked (BigInteger) power(BigInteger exponent)

Raises the current object to the power of another BigInteger.

public readonly locked (BigInteger) subtract(BigInteger other)

Subtracts another BigInteger from the current object and returns the resulting value.

public readonly locked (byte) toByte()

Converts the object to a byte value, possibly overflowing.

public readonly locked (code) toCode()

Converts the object to a code value, possibly overflowing.

public readonly locked (double) toDouble()

Converts the object to a double value.

public readonly locked (float) toFloat()

Converts the object to a float value.

public readonly locked (int) toInt()

Converts the object to an int value, possibly overflowing.

public readonly locked (long) toLong()

Converts the object to a long value, possibly overflowing.

public readonly locked (short) toShort()

Converts the object to a short value, possibly overflowing.

public readonly locked (String) toString()

Returns a String representation of the object, in base 10.

public readonly locked (String) toString(uint base)

Returns a String representation of the object, in the specified base.

public readonly locked (ubyte) toUByte()

Converts the object to a ubyte value, possibly overflowing.

public readonly locked (uint) toUInt()

Converts the object to a uint value, possibly overflowing.

public readonly locked (ulong) toULong()

Converts the object to a ulong value, possibly overflowing.

public readonly locked (ushort) toUShort()

Converts the object to a ushort value, possibly overflowing.

Create Detail

create

public create(int value) => ()

Creates a new BigInteger with the given int value.

Parameters

value - value of new object

create

public create(long value) => ()

Creates a new BigInteger with the given long value.

Parameters

value - value of new object

create

public create(String value) => ()

Creates a new BigInteger whose value is represented as text in base 10 by value.

Parameters

value - String representation of new object

create

public create(String value, uint base) => ()

Creates a new BigInteger whose value is represented as text in base base by value.

Parameters

value - String representation of new object

base - base of representation

create

public create(ulong value) => ()

Creates a new BigInteger with the given ulong value.

Parameters

value - value of new object

Destroy Detail

destroy

public destroy() => ()

Method Detail

abs

public readonly locked abs() => (BigInteger)

Returns a non-negative version of the object.

Returns

non-negative value

add

public readonly locked add(BigInteger other) => (BigInteger)

Adds another BigInteger to the current object and returns the resulting value.

Parameters

other - object to add

Returns

sum of the two values

bitShiftLeft

public readonly locked bitShiftLeft(int amount) => (BigInteger)

Finds the result of left-shifting the bits of the integer value that is represented.

Parameters

amount - bits to shift

Returns

shifted value

bitShiftRight

public readonly locked bitShiftRight(int amount) => (BigInteger)

Finds the result of right-shifting the bits of the integer value that is represented.

Parameters

amount - bits to shift

Returns

shifted value

compare

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.

Parameters

other - object to compare to

Returns

whether smaller, equal, or larger

copy

public readonly copy(AddressMap addresses) => (BigInteger)

divide

public readonly locked divide(BigInteger other) => (BigInteger)

Divides the current object by another BigInteger and returns the quotient.

Parameters

other - object to divide by

Returns

quotient of the division

equal

public readonly locked equal(BigInteger other) => (boolean)

Compares the current object to another BigInteger, returning true if they represent the same integer.

Parameters

other - object to compare to

Returns

true if identical

hash

public readonly locked hash() => (uint)

Finds a hash value for the current object.

Returns

hash value

max

public readonly locked max(BigInteger other) => (BigInteger)

Finds the maximum of the current object and another BigInteger.

Parameters

other - object

Returns

maximum value

min

public readonly locked min(BigInteger other) => (BigInteger)

Finds the minimum of the current object and another BigInteger.

Parameters

other - object

Returns

minimum value

modulus

public readonly locked modulus(BigInteger other) => (BigInteger)

Divides the current object by another BigInteger and returns the remainder.

Parameters

other - object to divide by

Returns

remainder of the division

modulusPower

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.

Parameters

exponent - power to raise by

divisor - value to modulo by

Returns

number after exponentiation and modulus

multiply

public readonly locked multiply(BigInteger other) => (BigInteger)

Multiplies the current object by another BigInteger and returns the resulting value.

Parameters

other - object to multiply

Returns

product of the two values

negate

public readonly locked negate() => (BigInteger)

Negates the object.

Returns

negated value

power

public readonly locked power(BigInteger exponent) => (BigInteger)

Raises the current object to the power of another BigInteger.

Parameters

exponent - power to raise by

Returns

number after exponentiation

subtract

public readonly locked subtract(BigInteger other) => (BigInteger)

Subtracts another BigInteger from the current object and returns the resulting value.

Parameters

other - object to subtract

Returns

difference of the two values

toByte

public readonly locked toByte() => (byte)

Converts the object to a byte value, possibly overflowing.

Returns

byte value

toCode

public readonly locked toCode() => (code)

Converts the object to a code value, possibly overflowing.

Returns

code value

toDouble

public readonly locked toDouble() => (double)

Converts the object to a double value.

Returns

double value

toFloat

public readonly locked toFloat() => (float)

Converts the object to a float value.

Returns

float value

toInt

public readonly locked toInt() => (int)

Converts the object to an int value, possibly overflowing.

Returns

int value

toLong

public readonly locked toLong() => (long)

Converts the object to a long value, possibly overflowing.

Returns

long value

toShort

public readonly locked toShort() => (short)

Converts the object to a short value, possibly overflowing.

Returns

short value

toString

public readonly locked toString() => (String)

Returns a String representation of the object, in base 10.

Returns

String representation

toString

public readonly locked toString(uint base) => (String)

Returns a String representation of the object, in the specified base.

Parameters

base - base of output representation

Returns

String representation

toUByte

public readonly locked toUByte() => (ubyte)

Converts the object to a ubyte value, possibly overflowing.

Returns

ubyte value

toUInt

public readonly locked toUInt() => (uint)

Converts the object to a uint value, possibly overflowing.

Returns

uint value

toULong

public readonly locked toULong() => (ulong)

Converts the object to a ulong value, possibly overflowing.

Returns

ulong value

toUShort

public readonly locked toUShort() => (ushort)

Converts the object to a ushort value, possibly overflowing.

Returns

ushort value