Table Of Contents

Changelog

Version 2.3

libmpdec

features

  1. New test suite with comprehensive tests against decNumber.
  2. Full support for compilers without uint64_t (tested with CompCert).

bug fixes

  1. If ROUND_FLOOR is set and the operand is zero, the functions mpd_plus() and mpd_minus() have special cases for the sign of the result.

cdecimal

features

  1. 100% code coverage, including all failures of Python API functions.
  2. Speed up int/Decimal conversion for integers that fit into a single word of a PyLongObject (performance gain is around 15%).
  3. Add real(), imag(), conjugate(), __complex__().
  4. Add Fraction and complex comparisons (enabled for Python-3.2). For compatibility reasons this feature is disabled for Python-2.x and Python-3.1; it can be enabled by removing some #ifdefs in the source.
  5. The Decimal constructor now accepts lists as well as tuples.
  6. Add support for DecimalTuple output.

bug fixes

  1. A couple of refleaks that could be triggered by unlikely failures of Python API functions have been fixed.

Version 2.2

libmpdec

build process

  1. configure: append CFLAGS to CONFIG flags.
  2. Makefile: use includedir, libdir, datarootdir, datadir, docdir, DESTDIR.

workarounds for toolchain bugs

  1. Enable workaround for a gcc miscompilation. See:

  2. Enable workaround for the glibc _FORTIFY_SOURCE/memmove bug, which is exposed by gcc-4.6. See:

features

  1. Make PPRO inline assembly PIC-compliant (for the dynamic library).

cdecimal

workarounds for toolchain bugs

  1. Enable the libmpdec workarounds in setup.py.

features

  1. deccheck.py: Suppress decimal.py bugs in max, min, max_mag, min_mag for Python versions 2.6.0 and 2.6.1.
  2. deccheck.py: Exit for Python versions 2.5.0-2.5.4, since there are uncharted bugs in decimal.py that yield false positives in the output. Note that cdecimal works fine, it is just impractical to run the tests.
  3. deccheck.py: Add proper exit status.

Thanks Hans-Peter Jansen for reporting many of these issues.

Version 2.1

Version 2.1 was never released, but escaped into the wild via the Makefile and setup.py in cdecimal-1.97-rc2.tar.gz. Both files already had that version number.

libmpdec

features

  1. Code coverage increased to 100%. This includes every possible allocation failure.
  2. Switch build process to ./configure.
  3. Makefile targets for creating coverage reports.

bug fixes

  1. mpd_qget_uint, mpd_qget_u64, mpd_qget_u32 did not raise for negative input.
  2. Handle allocation failures in _mpd_fntmul under extreme conditions.

cdecimal

features

  1. Full compatibility with decimal.py 3.2, including the new hash function and float operations.
  2. With the new FloatOperation signal, accidental float operations can be detected.
  3. The module has 85% code coverage. All lines except failures of Python C-API functions are tested.
  4. Add ‘rounding’ argument to quantize().

bug fixes

  1. Several minor bug fixes, most of them deal with proper handling of allocation failures under extreme conditions.

Version 1.2.1

libmpdec

bug fixes

  1. With MACHINE=ansi64, the macros BSR and BSF used x86 assembly. This caused compilation to fail on non-x64 platforms.

cdecimal

features

  1. setup.py: Build the module directly on AIX and let distutils figure out the linking.

bug fixes

  1. IMPORTANT: The traps in the DefaultContext and BasicContext were not initialized correctly, which prevented some exceptions from being raised.

    This bug was introduced in version 1.2 in the process of reworking DefaultContext/BasicContext.

  2. context.setflags() and context.settraps() incorrectly returned -1 instead of NULL/Py_NONE.

Version 1.2

libmpdec

features

  1. Support for compilers with __uint128_t (option MACHINE=ansi64).
  2. Support for other 64-bit compilers (option MACHINE=ansi64c32).
  3. Support for legacy compilers without uint64_t (option MACHINE=ansi-legacy).
  4. Slightly different build process (please read INSTALL.txt).
  5. If clamp=1, the maximum payload length of a NaN is prec-1.

bug fixes

  1. Fix for mpd_qround_to_int, which did not handle digits exceeding the context precision correctly in all cases.
  2. In rare corner cases Underflow was not set in transcendental functions.

cdecimal

features

  1. Speed up threading: New speed penalty is about 16%. The new default is to compile with thread local contexts enabled. To get the faster version without automatic thread context handling (previous default), compile –without-threads.
  2. Make clamp a public context field. Allow both _clamp and clamp for backwards compatibility.
  3. Add IEEEContext() factory function for interchange format contexts.
  4. All sNaN comparisons raise InvalidOperation.

compatibility fixes

  1. context.copy() should not zero the status.
  2. Module default context is initialized from DefaultContext on first access.
  3. Use DefaultContext for the Context() constructor.
  4. format() uses the ‘capitals’ setting of the context as default.
  5. Change order of Context.__repr__ to match decimal.py.