summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_decimal.py
Commit message (Collapse)AuthorAgeFilesLines
* Issue #22777: Test pickling with all protocols.Serhiy Storchaka2014-12-151-96/+98
|
* Issue #22090: Fix '%' formatting for infinities and NaNs.Stefan Krah2014-08-261-0/+5
|
* Issue #18492: Allow all resources when tests are not run by regrtest.py.Zachary Ware2014-06-021-2/+2
| | | | This changeset also includes cleanup allowed by this behavior change.
* Issue #21374: Fix pickling of DecimalTuple.Stefan Krah2014-04-291-0/+17
|
* Avoid UnicodeEncodeError by only printing ASCII.Zachary Ware2013-12-121-2/+2
| | | | | This fixes running test_decimal in verbose mode on Windows, which I broke in issue #19572.
* Issue 19572: More silently skipped tests explicitly skipped.Zachary Ware2013-12-081-11/+8
|
* 1) Prepare libmpdec for the 2.4.0 release. None of the following changes ↵Stefan Krah2013-11-241-0/+1
| | | | | | | | | | | | | | | | | | 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.
* Issue #18783: Removed existing mentions of Python long type in docstrings,Serhiy Storchaka2013-08-271-1/+1
| | | | error messages and comments.
* Backport bff16086f03b and bcaaaa00425b.Stefan Krah2013-05-291-0/+13
|
* Issue #17768: Support newline fill character in decimal.py and NUL fillStefan Krah2013-05-291-0/+4
| | | | character in _decimal.c.
* Issue #17047: remove doubled words added in 3.3Terry Jan Reedy2013-03-111-1/+1
| | | | as reported by Serhiy Storchaka and Matthew Barnett.
* Since the return type of format() is not a Decimal, raise ValueError instead ofStefan Krah2013-01-241-10/+4
| | | | | 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/+54
| | | | and pickling compatibility.
* Issue #15783: Support None default values in the Context() constructor.Stefan Krah2012-12-161-0/+21
|
* Issue #15783: Except for the number methods, the C version of decimal nowStefan Krah2012-12-151-8/+294
| | | | | 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/+10
|
* Issue #16431: Finally, consider all permutations.Stefan Krah2012-11-081-9/+24
|
* Issue #16431: Also fix the opposite direction.Stefan Krah2012-11-071-0/+4
|
* Issue #16431: Use the type information when constructing a Decimal subtypeStefan Krah2012-11-071-0/+5
| | | | from a Decimal argument.
* Closes #16080: The decorator ignores failed attempts to set the requiredStefan Krah2012-09-281-0/+6
| | | | locale, so an additional check is required.
* Issue #16080: Use run_with_locale() decorator to reset the locale properly.Stefan Krah2012-09-281-7/+3
|
* Issue #15882: Change _decimal to accept any coefficient tuple whenStefan Krah2012-09-101-7/+10
| | | | | | 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-0/+16
|
* Allow printing a leading '-' and the maximum number of exponent digitsStefan Krah2012-04-051-0/+48
| | | | | 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-0/+24
| | | | | conversion in the Decimal constructor. Exact here refers to the representation and not to the value (clamping does not change the value).
* Testing the implicit initialization of the thread local context on firstStefan Krah2012-04-021-70/+0
| | | | | access fails (expectedly) if other modules have already used decimal. The only option is to remove the test.
* Whitespace.Stefan Krah2012-04-021-57/+57
|
* Clear the context flags if a context is initialized from the DefaultContext.Stefan Krah2012-04-021-0/+70
|
* Raise MemoryError instead of InvalidOperation/MallocError for compatibilityStefan Krah2012-03-251-1/+1
| | | | | | 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.
* Use the same exception hierarchy as decimal.py. FloatOperation now alsoStefan Krah2012-03-231-0/+40
| | | | | inherits from TypeError. Cleanup in module initialization to make repeated import failures robust.
* Issue #7652: Integrate the decimal floating point libmpdec library to speedStefan Krah2012-03-211-362/+2948
| | | | | up the decimal module. Performance gains of the new C implementation are between 12x and 80x, depending on the application.
* Issue #13248, issue #8540: Remove deprecated Context._clamp attribute from ↵Mark Dickinson2011-10-241-12/+3
| | | | Decimal module.
* Issue #12079: Decimal(0).fma(Decimal('inf'), 'not a number') should give a ↵Mark Dickinson2011-05-221-0/+11
| | | | TypeError, not a Decimal.InvalidOperation
* #11565: Merge with 3.1.Ezio Melotti2011-03-161-1/+1
|\
| * #11565: Fix several typos. Patch by Piotr Kasprzyk.Ezio Melotti2011-03-161-1/+1
| |
| * Merged revisions 85503 via svnmerge fromAntoine Pitrou2010-10-141-8/+9
| | | | | | | | | | | | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/branches/py3k ........ r85503 | antoine.pitrou | 2010-10-15 00:11:44 +0200 (ven., 15 oct. 2010) | 2 lines More proper closing of files ........
| * Merged revisions 82646,82649-82650 via svnmerge fromMark Dickinson2010-07-081-41/+35
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/branches/py3k ........ r82646 | mark.dickinson | 2010-07-08 18:23:40 +0100 (Thu, 08 Jul 2010) | 1 line In test_decimal, convert heuristic for skipping tests into an explicit skiplist. ........ r82649 | mark.dickinson | 2010-07-08 20:03:34 +0100 (Thu, 08 Jul 2010) | 1 line Fix a performance issue in Decimal.pow. Thanks Stefan Krah for finding this. ........ r82650 | mark.dickinson | 2010-07-08 20:09:16 +0100 (Thu, 08 Jul 2010) | 1 line Fix misplaced exactness check that was causing unnecessary work in Decimal.__pow__. ........
| * Merged revisions 80755 via svnmerge fromMark Dickinson2010-05-041-0/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/branches/py3k ................ r80755 | mark.dickinson | 2010-05-04 15:35:33 +0100 (Tue, 04 May 2010) | 17 lines Merged revisions 80753 via svnmerge from svn+ssh://pythondev@svn.python.org/python/trunk ........ r80753 | mark.dickinson | 2010-05-04 15:25:50 +0100 (Tue, 04 May 2010) | 10 lines Issue #8567: Fix incorrect precedence of signals in Decimal module. When a Decimal operation raises multiple signals and more than one of those signals is trapped, the specification determines the order in which the signals should be handled. In many cases this order wasn't being followed, leading to the wrong Python exception being raised. This commit fixes those cases, and adds extra tests. The tests are only enabled when EXTENDEDERRORTESTS is True, since they involve rerunning each Decimal testcase several times. ........ ................
| * Merged revisions 75947 via svnmerge fromMark Dickinson2009-10-291-0/+47
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/branches/py3k ................ r75947 | mark.dickinson | 2009-10-29 12:23:02 +0000 (Thu, 29 Oct 2009) | 20 lines Merged revisions 75943-75945 via svnmerge from svn+ssh://pythondev@svn.python.org/python/trunk ........ r75943 | mark.dickinson | 2009-10-29 11:09:09 +0000 (Thu, 29 Oct 2009) | 1 line Fix duplicate test numbers in extra.decTest ........ r75944 | mark.dickinson | 2009-10-29 12:04:00 +0000 (Thu, 29 Oct 2009) | 3 lines Issue #7233: A number of two-argument Decimal methods were failing to accept ints and longs for the second argument. ........ r75945 | mark.dickinson | 2009-10-29 12:11:18 +0000 (Thu, 29 Oct 2009) | 4 lines Issue #7233: Fix Decimal.shift and Decimal.rotate methods for arguments with more digits than the current context precision. Bug reported by Stefan Krah. ........ ................
| * Merged revisions 75287 via svnmerge fromMark Dickinson2009-10-081-0/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | svn+ssh://pythondev@www.python.org/python/branches/py3k ................ r75287 | mark.dickinson | 2009-10-08 17:30:38 +0100 (Thu, 08 Oct 2009) | 9 lines Merged revisions 75286 via svnmerge from svn+ssh://pythondev@svn.python.org/python/trunk ........ r75286 | mark.dickinson | 2009-10-08 17:28:39 +0100 (Thu, 08 Oct 2009) | 2 lines Update decimal test data to the most recent set from Mike Cowlishaw. ........ ................
| * Merged revisions 74709 via svnmerge fromMark Dickinson2009-09-081-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | svn+ssh://pythondev@www.python.org/python/branches/py3k ................ r74709 | mark.dickinson | 2009-09-07 19:08:12 +0100 (Mon, 07 Sep 2009) | 9 lines Merged revisions 74708 via svnmerge from svn+ssh://pythondev@svn.python.org/python/trunk ........ r74708 | mark.dickinson | 2009-09-07 19:04:58 +0100 (Mon, 07 Sep 2009) | 2 lines #Issue 6795: Fix infinite recursion in long(Decimal('nan')); change int(Decimal('nan')) to raise ValueError instead of either returning NaN or raising InvalidContext. ........ ................
| * Merged revisions 74706 via svnmerge fromMark Dickinson2009-09-071-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | svn+ssh://pythondev@www.python.org/python/branches/py3k ................ r74706 | mark.dickinson | 2009-09-07 17:21:56 +0100 (Mon, 07 Sep 2009) | 10 lines Merged revisions 74704 via svnmerge from svn+ssh://pythondev@svn.python.org/python/trunk ........ r74704 | mark.dickinson | 2009-09-07 17:17:41 +0100 (Mon, 07 Sep 2009) | 3 lines Issue #6850: Fix bug in Decimal._parse_format_specifier for formats with no type specifier. ........ ................
| * Merged revisions 73715 via svnmerge fromGeorg Brandl2009-08-131-44/+44
| | | | | | | | | | | | | | | | | | | | svn+ssh://svn.python.org/python/branches/py3k ........ r73715 | benjamin.peterson | 2009-07-01 01:06:06 +0200 (Mi, 01 Jul 2009) | 1 line convert old fail* assertions to assert* ........
| * Merged revisions 74279 via svnmerge fromMark Dickinson2009-08-021-3/+9
| | | | | | | | | | | | | | | | | | | | svn+ssh://pythondev@www.python.org/python/branches/py3k ........ r74279 | mark.dickinson | 2009-08-02 11:14:23 +0100 (Sun, 02 Aug 2009) | 1 line Issue #6595: Allow Decimal constructor to accept non-European decimal digits, as recommended by the specification. ........
* | Issue #10624: Use support.requires_IEEE_754 in all appropriate tests.Eric Smith2010-12-041-6/+2
| |
* | Issue #7094: Add alternate ('#') flag to __format__ methods for float, ↵Eric Smith2010-11-251-0/+12
| | | | | | | | complex and Decimal. Allows greater control over when decimal points appear. Added to make transitioning from %-formatting easier. '#g' still has a problem with Decimal which I'll fix soon.
* | Revert r86517Raymond Hettinger2010-11-211-1/+1
| |
* | Issue #10356: hash(Decimal("sNaN")) now raises ValueError instead of TypeError.Stefan Krah2010-11-181-1/+1
| |
* | Issue #10356: Decimal(-1).__hash__() should equal hash(Decimal(-1)).Stefan Krah2010-11-171-14/+21
| |
* | More proper closing of filesAntoine Pitrou2010-10-141-8/+9
| |