mxNumber - Fast High-Precision Number Types for Python

Adds new GMP-based number types to Python in a very object-oriented way. mxNumber allows you to tap into the high-performance GMP library without getting in the way.
Version: 3.0.0


mxNumber is a Python extension package which provides a new set of basic numeric types, permitting very fast numeric operations.

The package uses the GNU Multi-Precision Library (GMP) as basis for providing this functionality at high performance and on a wide range of platforms including most Unix and Windows platforms. This library is licensed under the Library GNU Public License (LGPL) which means that it does not have the viral character as the standard GPL does. It usable with software which is not GPL-compatible, such as closed-source commercial software.


  • Fast numeric operations.
  • Flexible coercion model.
  • Supports arbitrary percision integers and floats.
  • Supports rational numbers for accurate decimal calculations.
  • Fully interoperable with Python's own numeric types and strings.
  • Fast, memory efficient, proven.
  • Stable, robust and portable.
  • Free to use and redistribute.

System Requirements

mxNumber is written in a very portable way and works on pretty much all platforms where you can compile Python. However, since mxNumber relies on the GMP library, you have to have a version of the GMP library installed on your system. We have successfully tested mxNumber with GMP 4.1.4.

We provide precompiled versions for all standard platforms, so all you need is a working Python and GMP installation.

For Windows, we supply a precompiled version of GMP 3.1 together with the package. You may want to use a more recent version from this site instead. Please note that we have not tested whether mxNumber runs with the binaries provided on that site. Use them at your own risk.

The package supports all Python versions since Python 2.1.

Note that mxNumber relies on the coercions features added to Python 2.1, which were developed by Marc-Andre Lemburg from and later integrated into Python with the help of Neil Schemenauer as part of PEP 208. Because of this, earlier Python releases will not work with mxNumber.

If you want to compile the package from source, you'll need an ANSI C compiler and the GMP library header files installed.


mxNumber is provided as part of the mx Experimental Distribution. Please see the mx Experimental Distribution page for details regarding the license.

The Windows package includes a pre-compiled version of the GNU Multi-Precision Library (GMP) Version 3.1 which ported to Windows.

The patches needed for porting GMP to Windows are included in the source package. These changes as well as the port itself are licenses under the Library GNU Public License (LGPL). The copyright for the changes remains with


The following documentation is available for mxNumber:

mxNumber User Manual and Reference Guide - HTML and PDF

The manual includes a reference of the available programming interfaces.

The PDF file is also available as part of the installation and can be found in the mx/Number/Doc/ folder.

Download & Installation

mxNumber is provided as part of the mx Experimental Distribution. Please see the mx Experimental Distribution page for downloads and installation instructions.


mxNumber was written by eGenix to experiment with decimal types for use in database decimal interfacing.

It has since been used in many applications by other interested parties and for educational purposes.

History & Changes

Please see the change log for details regarding changes to the package between releases.