Docs
chromia.com

TYPE

big_integer

On this page
type big_integer

An immutable signed integer type, supporting extremely large values (upwards of 100,000 decimal digits).

Literals of big_integer type can be written like integers, but with the suffix L, e.g. 123L or 0x123L. big_integers support the operators +, -, *, / and % with typical behavior.

Since 0.12.0

Attributes

PRECISION: integer = 131072

The maximum number of digits a big_integer can have, 131072, or 2^17.

Since 0.12.0

MIN_VALUE: big_integer = -99999999999999999999999999999999999999999999999999999999999999999999999

The minimum value a big_integer can have, -(10^131072)+1.

Since 0.12.0

MAX_VALUE: big_integer = 999999999999999999999999999999999999999999999999999999999999999999999999

The maximum value a big_integer can have, (10^131072)-1.

Since 0.12.0

Methods

abs
Returns the absolute value of this biginteger; i.e. the biginteger itself if it's positive
big_integer
from_bytes
Create a biginteger from a byte array.
from_bytes_unsigned
Create a biginteger from a byte array.
from_hex
Parses an unsigned hexadecimal text representation of a biginteger.
from_text
Parse a signed base-10 text representation of an integer.
max
Returns the greater of this and another biginteger value; i.e. value if value is greater than
min
Returns the lesser of this and another biginteger value; i.e. value if value is less than
pow
Raise this biginteger to the power of the given exponent. SQL compatible.
sign
Returns the sign of this biginteger: -1 if negative, 0 if zero, and 1 if positive.
to_bytes
Convert this biginteger to a byte array.
to_bytes_unsigned
Convert this non-negative biginteger to a byte array, with no sign bit.
to_decimal
Convert this biginteger to a decimal.
to_hex
Convert this biginteger to hexadecimal text.
to_integer
Convert this biginteger to an integer.
to_text
Convert this biginteger to a base 10 text representation.