[ANN] cdecimal-2.3 released

Stefan Krah stefan at bytereef.org
Thu Feb 2 21:54:04 CET 2012


I'm pleased to announce the release of cdecimal-2.3. cdecimal is a fast
drop-in replacement for the decimal module in Python's standard library.


cdecimal is a complete implementation of IBM's General Decimal Arithmetic
Specification. With the appropriate context parameters, cdecimal will also
conform to the IEEE 754-2008 Standard for Floating-Point Arithmetic.

Typical performance gains over decimal.py are between 30x for I/O heavy
benchmarks and 80x for numerical programs. In a PostgreSQL database
benchmark, the speedup is 12x.

    |         |   decimal   |   cdecimal   |   speedup   |
    |   pi    |    42.75s   |    0.58s     |     74x     |
    | telco   |   172.19s   |    5.68s     |     30x     |
    | psycopg |     3.57s   |    0.29s     |     12x     |

In the pi benchmark, cdecimal often performs better than Java's BigDecimal
running on Java HotSpot(TM) 64-Bit Server VM.

What's New

    o The underlying library - libmpdec - now has a very comprehensive
      test suite against decNumber.

    o libmpdec now has full support for compilers without uint64_t.

    o Code coverage of cdecimal has been increased to 100%. Now both
      libmpdec and cdecimal have 100% coverage.

    o Improved code for conversion of small Python integers to Decimals
      leads to a performance gain of around 15%.

    o Added real(), imag(), conjugate(), __complex__() methods.

    o Add Fraction and complex comparisons (enabled for Python 3.2).

    o Support for DecimalTuple output.


Both cdecimal and libmpdec have an extremely conservative release policy.
When new features are added, the complete test suite is run both with and
without Valgrind on many different platforms. With the added tests against
decNumber, this takes around 8 months on four cores.


Since cdecimal is listed on PyPI, it can be installed using pip:

    pip install cdecimal

Windows installers are available at:




Checksums of the released packages

03f76f4acbb6e7f648c6efc6e424bbc1b4afb5632dac5196f840e71f603a2b4a  mpdecimal-2.3.tar.gz
b0fd5bec2cc6a6035bc406339d020d2f4200a7dce8e8136a2850612a06508ed1  mpdecimal-2.3.zip
d737cbe43ed1f6ad9874fb86c3db1e9bbe20c0c750868fde5be3f379ade83d8b  cdecimal-2.3.tar.gz

84afd94126549a3c67c3bab7437d085347f9d05c  cdecimal-2.3.win-amd64-py2.6.msi
ba0fbb1f9314dcef29481414a5c3496ec159df2e  cdecimal-2.3.win-amd64-py2.7.msi
d11bbd560e9cb9d34b0e7a068ac1c1eac5371428  cdecimal-2.3.win-amd64-py3.1.msi
d024148ea603dc8e82f8371ebdfaa0e65f5a9945  cdecimal-2.3.win-amd64-py3.2.msi
d196a9e0b44dcb75bbf4eda44078b766e6113f72  cdecimal-2.3.win32-py2.6.msi
e2b044da6c241df0911059216821c9865cb9e4f0  cdecimal-2.3.win32-py2.7.msi
7e8b47eb3a2f50191e76f981fbe55050f13495e8  cdecimal-2.3.win32-py3.1.msi
61be767b91aab0ba0d602fb2b23f6d882cafec05  cdecimal-2.3.win32-py3.2.msi

a2278910a5b447af963e1d427dbeb48f49e377be  cdecimal-2.3-no-thread.win-amd64-py2.6.msi
8da96d2f1ab1a98062cd43cb4f381b47309d8c22  cdecimal-2.3-no-thread.win-amd64-py2.7.msi
85cd3ff4496aa7e0d0979d1695eef27cc7735c28  cdecimal-2.3-no-thread.win-amd64-py3.1.msi
6c179a1284aceb3a7bfc481daae1d7d60359d487  cdecimal-2.3-no-thread.win-amd64-py3.2.msi
40f245e907512c5d3602ba5993755a0b4b67ca80  cdecimal-2.3-no-thread.win32-py2.6.msi
960eb9bfd9fcf0faee6493506c1917d46536193a  cdecimal-2.3-no-thread.win32-py2.7.msi
42b651ee1bf4c94611c43522d69f1965515949b8  cdecimal-2.3-no-thread.win32-py3.1.msi
ec26f14c35502d1d5488d440d7bc22ad41e9ac65  cdecimal-2.3-no-thread.win32-py3.2.msi

More information about the Python-announce-list mailing list