summaryrefslogtreecommitdiffstats
path: root/Modules/_decimal/_decimal.c
Commit message (Collapse)AuthorAgeFilesLines
* Merge 3.5.Stefan Krah2016-07-171-8/+51
|\
| * Issue #26974: Fix segfault in the presence of absurd subclassing. ProactivelyStefan Krah2016-07-171-3/+47
| | | | | | | | eliminate all internal uses of overridden methods.
* | Merge 3.5.Stefan Krah2016-06-201-1/+1
|\ \ | |/
| * Issue #27006: Do not use PyDec_CheckExact() on a type.Stefan Krah2016-06-201-1/+1
| |
* | Merge 3.5.Stefan Krah2016-06-201-2/+8
|\ \ | |/
| * Issue #27006: from_float(): call the subclass' __new__() and __init__().Stefan Krah2016-06-201-2/+8
| |
* | Issue #26846: Post commit cleanup.Stefan Krah2016-04-261-1/+0
| |
* | Issue #26200: Restored more safe usages of Py_SETREF.Serhiy Storchaka2016-04-111-4/+4
|\ \ | |/
* | Issue #22570: Renamed Py_SETREF to Py_XSETREF.Serhiy Storchaka2016-04-061-4/+4
|\ \ | |/
* | Issue #25928: Add Decimal.as_integer_ratio(). Python parts and docs byStefan Krah2015-12-281-0/+101
|/ | | | Mark Dickinson.
* Issue #25421: __sizeof__ methods of builtin types now use dynamic basic size.Serhiy Storchaka2015-12-191-1/+1
| | | | | This allows sys.getsize() to work correctly with their subclasses with __slots__ defined.
* Removed redundant casts to `char *`.Serhiy Storchaka2014-09-281-2/+2
| | | | Corresponding functions now accept `const char *` (issue #1772673).
* Introduce and check for MPD_VERSION_HEX for precise management of buildsStefan Krah2014-08-261-2/+2
| | | | with an external libmpdec.
* Issue #21374: Fix pickling of DecimalTuple.Stefan Krah2014-04-291-4/+9
|
* remove unused zero constantsBenjamin Peterson2014-03-151-3/+0
|
* 1) Prepare libmpdec for the 2.4.0 release. None of the following changes ↵Stefan Krah2013-11-241-1/+7
| | | | | | | | | | | | | | | | | | affects _decimal: o Make all "mpd_t to C integer" conversion functions available in both the 64-bit and the 32-bit versions. o Make all mixed mpd_t/C integer arithmetic functions available in the 32-bit version. o Better handling of __STDC_LIMIT_MACROS for C++ users. o Add struct tags (at the request of C++ users). 2) Check for libmpdec.so.2 if --with-system-libmpdec is used.
* Move PyErr_NoMemory() closer to the failure.Stefan Krah2013-11-081-1/+1
|
* Change style to match the surrounding code (no early returns).Stefan Krah2013-11-081-4/+3
|
* Issue #19437: Fix dec_format() of the _decimal module, handle dec_strdup()Victor Stinner2013-10-291-0/+1
| | | | failure (memory allocation failure): raise a MemoryError exception
* Issue #19437: Fix convert_op_cmp() of decimal.Decimal rich comparator, handleVictor Stinner2013-10-291-10/+17
| | | | PyObject_IsInstance() failure
* Backport bff16086f03b and bcaaaa00425b.Stefan Krah2013-05-291-5/+5
|
* Issue #17768: Support newline fill character in decimal.py and NUL fillStefan Krah2013-05-291-9/+55
| | | | character in _decimal.c.
* Since the return type of format() is not a Decimal, raise ValueError instead ofStefan Krah2013-01-241-1/+7
| | | | | InvalidOperation if the format specification (width, prec) exceeds the internal limits of libmpdec.
* Issue #16422: Use strings for rounding mode constants for better readabilityStefan Krah2013-01-161-65/+55
| | | | and pickling compatibility.
* Issue #16745: Hide a couple of symbols by making them local.Stefan Krah2012-12-211-1/+1
|
* Issue #15783: Support None default values in the Context() constructor.Stefan Krah2012-12-161-30/+33
|
* Issue #15783: Except for the number methods, the C version of decimal nowStefan Krah2012-12-151-84/+103
| | | | | supports all None default values present in decimal.py. These values were largely undocumented.
* Accept Unicode legacy strings in the Decimal constructor.Stefan Krah2012-11-101-1/+3
|
* Issue #16431: Finally, consider all permutations.Stefan Krah2012-11-081-2/+2
|
* Issue #16431: Also fix the opposite direction.Stefan Krah2012-11-071-1/+1
|
* Issue #16431: Use the type information when constructing a Decimal subtypeStefan Krah2012-11-071-2/+27
| | | | from a Decimal argument.
* Issue #15882: Change _decimal to accept any coefficient tuple whenStefan Krah2012-09-101-0/+7
| | | | | | constructing infinities. This is done for backwards compatibility with decimal.py: Infinity coefficients are undefined in _decimal (in accordance with the specification).
* Issue #15544: Fix Decimal.__float__ to work with payload-carrying NaNs.Mark Dickinson2012-08-241-1/+17
|
* mpd_qpowmod(): calculate result with zero-exponent for compatibility withStefan Krah2012-08-231-8/+0
| | | | decimal.py. The hack to remove the ideal exponent is no longer required.
* In the 32-bit build, dec_hash() raised InvalidOperation if the operandStefan Krah2012-08-221-4/+12
| | | | | | had a coefficient with MAX_PREC=425000000 digits and a negative exponent. Increasing the context limits above the official values fixes the issue and is safe (in this case!).
* Add unused parameter to a couple of METH_NOARGS functions. The previousStefan Krah2012-07-281-8/+8
| | | | | form is used in many places in the source tree, but was found to be incorrect in a recent tracker discussion.
* Proactive reliability fix for broken FPUs: The base conversion functionsStefan Krah2012-06-301-18/+20
| | | | | | | | | | use log10() to calculate the size of the output array. The current code has been tested on x86/amd64 (and to a lesser extent on qemu-mips qemu-sparc) and produces sufficiently large values for all inputs tested so far (coefficient sizes of 10**18 - 1 are hard to test exhaustively). The new code does not rely on the correctness of log10() and resizes the output arrays if the allocated space is insufficient.
* Speed up _decimal by another 10-15% by caching the thread local contextStefan Krah2012-06-241-21/+58
| | | | | that was last accessed. In the pi benchmark (64-bit platform, prec=9), _decimal is now only 1.5x slower than float.
* Issue #14478: Cache the hash of a Decimal in the C version.Stefan Krah2012-04-101-1/+14
|
* Issue #14520: Add __sizeof__() method to the Decimal object.Stefan Krah2012-04-091-0/+14
|
* Speed up _decimal by 30-40% for numerical workloads by improving the cacheStefan Krah2012-04-091-16/+18
| | | | locality for regularly sized coefficients.
* Use the MPD() accessor macro.Stefan Krah2012-04-091-2/+2
|
* Whitespace.Stefan Krah2012-04-051-1/+1
|
* Reduce array size.Stefan Krah2012-04-051-1/+1
|
* Formatting.Stefan Krah2012-04-051-2/+2
|
* Allow printing a leading '-' and the maximum number of exponent digitsStefan Krah2012-04-051-2/+2
| | | | | rather than raising RuntimeError (allocated space is sufficient for the additional character).
* Raise InvalidOperation if exponents of zeros are clamped during exactStefan Krah2012-04-051-2/+2
| | | | | conversion in the Decimal constructor. Exact here refers to the representation and not to the value (clamping does not change the value).
* Improve comments.Stefan Krah2012-04-021-5/+5
|
* Clear the context flags if a context is initialized from the DefaultContext.Stefan Krah2012-04-021-0/+8
|
* Raise MemoryError instead of InvalidOperation/MallocError for compatibilityStefan Krah2012-03-251-1/+8
| | | | | | with decimal.py. The standard specifies InsufficientStorage (MallocError) as a sub-condition of InvalidOperation. This allows a calculation to continue with NaN results when allocation fails.