Introduction to gmpy2¶
gmpy2 is a C-coded Python extension module that supports multiple-precision arithmetic. gmpy2 is the successor to the original gmpy module. The gmpy module only supported the GMP multiple-precision library. gmpy2 adds support for the MPFR (correctly rounded real floating-point arithmetic) and MPC (correctly rounded complex floating-point arithmetic) libraries. gmpy2 also updates the API and naming conventions to be more consistent and support the additional functionality.
The following libraries are supported:
GMP for integer and rational arithmetic
Home page: http://gmplib.org
MPFR for correctly rounded real floating-point arithmetic
Home page: http://www.mpfr.org
MPC for correctly rounded complex floating-point arithmetic
Home page: http://mpc.multiprecision.org
Generalized Lucas sequences and primality tests are based on the following code:
mpz_lucas: http://sourceforge.net/projects/mpzlucas/
gmpy2 Versions¶
gmpy2 2.1.3 is the last planned release that will support Python 2.7 and the early Python 3 releases. Bugfixes may be released.
Development will shift to gmpy2 2.2.x
Installation¶
Pre-compiled binary wheels are available on PyPI for Linux, MacOS, and Windows.