Gmp.mpz implements very large integers. In fact, the only limitation on these integers is the available memory. The mpz object implements all the normal integer operations.
Note that the auto-bignum feature also makes these operations available "in" normal integers. For instance, to calculate the greatest common divisor between
85, you can do
- Method create
Create and initialize a Gmp.mpz object.
Initial value. If no value is specified, the object will be initialized to zero.
Base the value is specified in. The default base is base 10. The base can be either a value in the range [2..36] (inclusive), in which case the numbers are taken from the ASCII range 0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ (case-insensitive), in the range [37..62] (inclusive), in which case the ASCII range will be case sensitive, or either of the values
-256, in which case value is taken to be the unsigned binary representation in network byte order or reversed byte order respectively.
Values in base [2..62] can be prefixed with
"-". If no base is given, values prefixed with
"0B"will be interpreted as binary. Values prefixed with
"0X"will be interpreted as hexadecimal. Values prefixed with
"0"will be interpreted as octal.
Leading zeroes in value are not significant when a base is explicitly given. In particular leading NUL characters are not preserved in the base 256 modes.
Before GMP 5.0 only bases 2-36 and 256 were supported.