Method Gmp.mpz()->create()
- Method create
Gmp.mpz Gmp.mpz()
Gmp.mpz Gmp.mpz(
string
|int
|float
|object
value
)
Gmp.mpz Gmp.mpz(
string
value
,int(2..36)
|int(256..256)
|int(-256..-256)
base
)- Description
Create and initialize a Gmp.mpz object.
- Parameter
value
Initial value. If no value is specified, the object will be initialized to zero.
- Parameter
base
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), or either of the values
256
or-256
, in which casevalue
is taken to be the unsigned binary representation in network byte order or reversed byte order respectively.Values in base [2..36] can be prefixed with
"+"
or"-"
. Values prefixed with"0b"
or"0B"
will be interpreted as binary. Values prefixed with"0x"
or"0X"
will be interpreted as hexadecimal. Values prefixed with"0"
will be interpreted as octal.- Note
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.