Miscellaneous Functions

gmpy2.digits(x, base=10, prec=0, /)

Return string representing a number.

gmpy2.from_binary(bytes, /)

Return a Python object from a byte sequence created by to_binary().

gmpy2.license()

Return string giving license information.

gmpy2.mp_limbsize()

Return the number of bits per limb.

gmpy2.mp_version()

Return string giving current GMP version.

gmpy2.mpc_version()

Return string giving current MPC version.

gmpy2.mpfr_version()

Return string giving current MPFR version.

gmpy2.random_state(seed=0, /)

Return new object containing state information for the random number generator. An optional integer can be specified as the seed value.

gmpy2.to_binary(x, /)

Return a Python byte sequence that is a portable binary representation of a gmpy2 object x. The byte sequence can be passed to from_binary() to obtain an exact copy of x’s value. Raises a TypeError if x is not a gmpy2 object.

gmpy2.version()

Return string giving current GMPY2 version.