Skip to main content

Overview

The cdecimal package is a fast drop-in replacement for the decimal module in Python’s standard library. Both modules provide complete implementations of Mike Cowlishaw/IBM’s General Decimal Arithmetic Specification.

Testing

Both cdecimal and the underlying library - libmpdec - are extremely well tested. libmpdec is one of the few open source projects with 100% code coverage. cdecimal is rigorously tested against decimal.py.

Short benchmarks

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

decimal

cdecimal

speedup

pi

42.75s

0.58s

74x

telco

172.19s

5.68s

30x

psycopg

3.57s

0.29s

12x

Documentation

Since cdecimal is compatible with decimal.py, the official documentation is valid. For the few remaining differences, refer to the second link.

Linux Notes

The build process requires a working C compiler and a full Python install with development headers. Linux distributions often ship the Python header files as a separate package, called python-dev or python-devel.

Install headers on Debian/Ubuntu:

  • sudo apt-get install python-dev

Windows Notes

Metadata

Release files for gryphon-cdecimal 2.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for gryphon-cdecimal 2.3
File Size Uploaded
gryphon-cdecimal-2.3.tar.gz 383.1 kB Details

Release files / gryphon-cdecimal-2.3.tar.gz

Download URL gryphon-cdecimal-2.3.tar.gz
Size 383.1 kB
Tags Source
SHA-256 checksum
How to use checksums
505145c8873939bdcebc5ede802372fe2065cb5c82a4dfa03692b9252ebe8545
BLAKE2b-256 checksum
How to use checksums
4ee7be0213d30676f2944d110015ec57b9f2900a343835a12159ceb83995c2de
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.11.0 pkginfo/1.4.2 requests/2.19.1 setuptools/40.0.0 requests-toolbelt/0.8.0 tqdm/4.25.0 CPython/2.7.10

Release history Release notifications | RSS feed

This release

2.3 This release

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page