My favorites | Sign in
Project Home Downloads Wiki Issues Source
Project Information
Members
Featured
Downloads
Links

GMPY and GMPY2 are C-coded Python extension modules that support fast multiple-precision arithmetic. GMPY only supports the GMP library and provides fast multiple-precision integer and rational arithmetic. The limited mpf type from GMP is also supported.

GMPY2 supports the GMP library for integer and rational arithmetic but GMPY2 adds support for multiple-precision real and complex arithmetic as provided by the MPFR and MPC libraries.

News

April 8, 2012

GMPY2 2.0.0b1 is now available. GMPY2 adds several new capabilities:

  1. Reworked context manager.
  2. Support for complex arithmetic using the MPC library.
  3. Support for PEP 3101 string formatting.
  4. Support for additional number theory and primality testing functions.

Documentation is available at Read The Docs.

Comments on installation via pip

If you want to install gmpy 1.15, use the command:

pip install "gmpy==1.15"

If you are installing gmpy2, you will (most likely) need to compile the required versions of GMP, MPFR, and MPC. If the required versions are installed in /opt/local, then the following command will install gmpy2:

pip install gmpy --global-option=build_ext --global-option=-Ddir=/opt/local

January 12, 2012

GMPY 1.15 is a bug fix release. The following bugs were fixed:

  1. Reference counting leak in divmod(x,0).
  2. Fatal crash in remove(x,1).
  3. Discontinue use of custom memory allocator. (Fixes compatibility with Sage.)
  4. Allow up to base-62 integer conversion.

Installers for versions not listed on the home page are available on the Downloads tab.

Powered by Google Project Hosting