summaryrefslogtreecommitdiffstats
path: root/Modules/_decimal
Commit message (Collapse)AuthorAgeFilesLines
* Support multiarch build in tests.Stefan Krah2013-05-291-7/+8
|
* Backport bff16086f03b and bcaaaa00425b.Stefan Krah2013-05-291-5/+5
|
* Issue #17768: Support newline fill character in decimal.py and NUL fillStefan Krah2013-05-293-15/+59
| | | | character in _decimal.c.
* Fix a few typos and a double semicolon. Patch by Eitan Adler.Ezio Melotti2013-01-271-1/+1
|
* 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.
* Remove trailing whitespace.Stefan Krah2013-01-1611-23/+23
|
* Issue #16422: Use strings for rounding mode constants for better readabilityStefan Krah2013-01-162-87/+69
| | | | and pickling compatibility.
* Issue #16753: Define __GNUC_STDC_INLINE__ to an integer (same as gcc).Stefan Krah2012-12-231-1/+1
|
* Issue #16745: The gcc visibility pragma is buggy on OpenIndiana and NetBSD.Stefan Krah2012-12-221-1/+2
|
* Fix Visual Studio build.Stefan Krah2012-12-221-0/+3
|
* Issue #16745: Hide symbols in _decimal.so.Stefan Krah2012-12-2212-1/+95
|
* Issue #16745: Hide a couple of symbols by making them local.Stefan Krah2012-12-212-8/+8
|
* 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-154-178/+267
| | | | | 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.
* Support gcc's -ansi flag: use "__asm__" instead of "asm".Stefan Krah2012-09-302-94/+94
|
* Revert 29506c7db353 (build output should be accurate).Stefan Krah2012-09-301-5/+0
|
* mergeChristian Heimes2012-09-301-2/+7
|\
| * Make it clear that the pi function is modified for benchmarking purposes.Stefan Krah2012-09-301-2/+7
| |
* | Change libmpdec to use ANSI code in strict ansi mode as inline asm isn't ↵Christian Heimes2012-09-301-0/+5
|/ | | | supported in ANSI C
* Restore the benchmark order to avoid waiting for decimal.py if just theStefan Krah2012-09-251-3/+4
| | | | prec=9 test is used.
* Fix whitespace.Brett Cannon2012-09-251-1/+1
|
* Fix whitespace.Brett Cannon2012-09-251-18/+18
|
* Make the decimal bench file run under Python 2.7.Brett Cannon2012-09-251-18/+28
|
* Use C-style comments.Stefan Krah2012-09-231-24/+24
|
* 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-232-23/+17
| | | | decimal.py. The hack to remove the ideal exponent is no longer required.
* Use zero bottom margin.Stefan Krah2012-08-221-3/+0
|
* In the 32-bit build, dec_hash() raised InvalidOperation if the operandStefan Krah2012-08-222-4/+57
| | | | | | 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!).
* 1) Use _mpd_basedivmod() regardless of the length of the dividend. This isStefan Krah2012-08-221-6/+9
| | | | | | | | | | required for a corner case in dec_hash() in the following commit and also usually faster. dec_hash() needs some extra precision above MPD_MAX_PREC, and _mpd_base_ndivmod() is not audited for that. 2) Use _mpd_basemul() if the length of the smaller operand is less than or equal to 256. While this is technically an optimization, it is required for *testing* corner cases in dec_hash() in reasonable time.
* 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.
* Fix Visual Studio warning.Stefan Krah2012-07-201-1/+1
|
* Issue #7652: Clean up _mpd_qinvroot() and mark it LIBMPDEC_ONLY. Use theStefan Krah2012-07-121-135/+140
| | | | algorithm from decimal.py for mpd_qsqrt().
* Remove ISSUES.txt.Stefan Krah2012-07-011-56/+0
|
* After 79d2eb29c755 it is no longer necessary to zero the output array:Stefan Krah2012-06-301-4/+4
| | | | | | None of the _mpd_shortadd() or _mpd_shortmul() functions read uninitialized values. Previously zeroing was required since _mpd_real_size() was called on the output array.
* Proactive reliability fix for broken FPUs: The base conversion functionsStefan Krah2012-06-305-198/+409
| | | | | | | | | | 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.
* Update test script to Visual Studio 2010.Stefan Krah2012-06-252-42/+32
|
* Make the benchmark more fair for _decimal/decimal.py by setting context.precStefan Krah2012-06-241-6/+6
| | | | only once (float obviously doesn't set any context at all).
* 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.
* Whitespace.Stefan Krah2012-06-221-1/+1
|
* Fix comment.Stefan Krah2012-06-201-1/+1
|
* Many cleanups of redundant code in mpd_qrem_near():Stefan Krah2012-06-201-23/+15
| | | | | | | | | | | | | | | | | | 1) _mpd_qdivmod() uses the context precision only in two places, and the new code should be exactly equivalent to the previous code. 2) Remove misleading comment. 3) The quotient *is* an integer with exponent 0, so calling mpd_qtrunc() is pointless. 4) Replace two instances of identical code by a single one. 5) Use _mpd_cmp_abs() instead of mpd_cmp_total_mag(): the operands are not special. 6) Don't clear MPD_Rounded in the status (with the current code it should not be set within the function).
* Add comments to the power functions, in particular to _mpd_qpow_real().Stefan Krah2012-06-181-5/+34
|
* 1) State the relative errors of the power functions for integer exponents.Stefan Krah2012-06-161-2/+18
| | | | | | | | | | | | | | | 2) _mpd_qpow_mpd(): Abort the loop for all specials, not only infinity. 3) _mpd_qpow_mpd(): Make the function more general and distinguish between zero clamping and folding down the exponent. The latter case is currently handled by setting context->clamp to 0 before calling the function. 4) _mpd_qpow_int(): Add one to the work precision in case of a negative exponent. This is to get the same relative error (0.1 * 10**-prec) for both positive and negative exponents. The previous relative error for negative exponents was (0.2 * 10**-prec). Both errors are _before_ the final rounding to the context precision.
* 1) Fix signature of _mpd_qpow_uint(): contrary to the comment base is constant.Stefan Krah2012-06-121-7/+9
| | | | | | | | 2) Abort the loop for all specials, not only infinity. 3) Make the function more general and distinguish between zero clamping and folding down the exponent. The latter case is currently handled by setting context->clamp to 0 before calling the function.
* 1) Replace long-winded abort() construct by assert().Stefan Krah2012-06-111-31/+28
| | | | | 2) Remove micro optimization (inline checking for NaN before calling mpd_qcheck_nans()) that probably has no benefit in this case.