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
Links
Metadata
Release files for m3-cdecimal 2.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| m3-cdecimal-2.3.tar.gz | 640.0 kB | Without provenance | Details for m3-cdecimal-2.3.tar.gz |
Release files / m3-cdecimal-2.3.tar.gz
| Download URL | m3-cdecimal-2.3.tar.gz |
|---|---|
| Size | 640.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
55406e987fc6fabf21925d1496371d1ae55e61f66b62f2eaa5e152d0e56f3771
|
|
BLAKE2b-256 checksum How to use checksums |
3848f971b928e29d7c163dd01f265c294417dfe898bd07a1d8dcc3da9e69c0b9
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Security for m3-cdecimal 2.3
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.