I'm pleased to annouce the release both a production and
experimental release of GMPY. GMPY is a wrapper for the
MPIR or GMP multiple-precision arithmetic library. GMPY
is available for download from:
GMPY 1.12 is the new stable release. In addition to fixing
a few bugs, GMPY 1.12 adds support for Python 2.7 and the
current py3k development trunk. Even though my primary
development focus has shifted to GMPY2 (see below), GMPY
1.X will continue to receive bug and compatibility fixes.
To simplify the codebase, allow for changes in the API,
and support simultaneous installation, the development
version has been renamed to GMPY2. The following is list
of changes in GMPY2:
* support for a mutable integer type "xmpz"
* removal of random number functions
* "xmpz" supports slices for setting/clearing bits
* some methods have been renamed (scan1 -> bit_scan1)
* support for Python prior to 2.6 has been removed
* support for all division modes has been added
* ceiling - round to +Infinity
* floor - round to -Infinity
* truncate - round to zero
* 2exp - division by a power of 2
* support is_even() and is_odd()
If you use GMPY regularly, please test GMPY2. There have been
several requests asking for a mutable integer and I am curious
if there are real-world performance improvements.
I am looking for feedback on future enhancements. If you have
specific requests, please let me know. Below are some ideas
* An optional "max_bits" parameter for an "xmpz". If
specified, all results would be calculated modulo
* I've added the ability to set/clear bits of an "xmpz"
using slice notation. Should I allow the source to be
arbitrary set of bits or require that all bits are set
to 0 or 1? Should support for "max_bits" be required?
* Improved floating point support.
Comments on provided binaries
The pre-compiled Windows installers use later versions of
GMP and MPIR so performance some operations should be
The 32-bit Windows installers were compiled with MinGW32 using
GMP 5.0.1 and will automatically recognize the CPU type and use
assembly code optimized for the CPU at runtime. The 64-bit
Windows installers were compiled Microsoft's SDK compilers
using MPIR 2.1.1. Detailed instructions are included if you
want to compile your own binary.
Please report any issues!