summaryrefslogtreecommitdiffstats
path: root/Lib/decimal.py
Commit message (Collapse)AuthorAgeFilesLines
* merge from 3.3Senthil Kumaran2013-09-081-1/+1
|\ | | | | | | | | Fix the dead link of IEEE_854-1987 standard with the Wikipedia entry. Addresses issue #18438
| * Fix the dead link of IEEE_854-1987 standard with the Wikipedia entry.Senthil Kumaran2013-09-081-1/+1
| | | | | | | | Addresses issue #18438
* | Issue #18200: Back out usage of ModuleNotFoundError (8d28d44f3a9a)Brett Cannon2013-07-041-4/+4
| |
* | Issue #18200: Update the stdlib (except tests) to useBrett Cannon2013-06-141-4/+4
| | | | | | | | ModuleNotFoundError.
* | Merge 3.3.Stefan Krah2013-05-291-1/+1
|\ \ | |/
| * Issue #17768: Support newline fill character in decimal.py and NUL fillStefan Krah2013-05-291-1/+1
| | | | | | | | character in _decimal.c.
* | Merge 3.3.Stefan Krah2012-12-151-6/+6
|\ \ | |/
| * Issue #15783: Except for the number methods, the C version of decimal nowStefan Krah2012-12-151-6/+6
| | | | | | | | | | supports all None default values present in decimal.py. These values were largely undocumented.
* | Issue #13701: Fix decorator avoidance (due to desire for Python 2.3 ↵Mark Dickinson2012-10-311-3/+1
|/ | | | compatibility) in decimal module.
* Issue #15544: Fix Decimal.__float__ to work with payload-carrying NaNs.Mark Dickinson2012-08-241-1/+7
|
* Use the same exception hierarchy as decimal.py. FloatOperation now alsoStefan Krah2012-03-231-1/+1
| | | | | 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-31/+163
| | | | | 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-22/+0
| | | | Decimal module.
* Issue #12080: Fix a performance issue in Decimal._power_exact that causes ↵Mark Dickinson2011-06-041-38/+81
| | | | some corner-case Decimal.__pow__ calls to take an unreasonably long time.
* Issue #12079: Decimal(0).fma(Decimal('inf'), 'not a number') should give a ↵Mark Dickinson2011-05-221-1/+1
| | | | TypeError, not a Decimal.InvalidOperation
* Issue #11830: Remove unnecessary introspection code in the decimal module.Alexander Belopolsky2011-04-131-17/+14
| | | | | Forward ported changesets b4b1f557d563 and f4adc2926bf5 by Raymond Hettinger in branch '2.7'.
* #11515: Merge with 3.1.Ezio Melotti2011-03-151-1/+1
|\
| * #11515: fix several typos. Patch by Piotr Kasprzyk.Ezio Melotti2011-03-151-1/+1
| |
* | Merge #11131Mark Dickinson2011-03-121-8/+11
|\ \ | |/
| * Issue 11131: Fix sign of zero result on decimal.Decimal plus and minus ↵Mark Dickinson2011-03-121-8/+11
| | | | | | | | operations in ROUND_FLOOR rounding mode.
| * Merged revisions 82654 via svnmerge fromMark Dickinson2010-07-081-13/+31
| | | | | | | | | | | | | | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/branches/py3k ........ r82654 | mark.dickinson | 2010-07-08 22:15:36 +0100 (Thu, 08 Jul 2010) | 3 lines Issue #9136: Profiling Decimal gave 'dictionary changed size during iteration'. Remove the use of locals() that caused this error. ........
| * Merged revisions 82646,82649-82650 via svnmerge fromMark Dickinson2010-07-081-9/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 81352 via svnmerge fromStefan Krah2010-05-191-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/branches/py3k ................ r81352 | stefan.krah | 2010-05-19 17:52:31 +0200 (Wed, 19 May 2010) | 9 lines Merged revisions 81350 via svnmerge from svn+ssh://pythondev@svn.python.org/python/trunk ........ r81350 | stefan.krah | 2010-05-19 17:46:39 +0200 (Wed, 19 May 2010) | 1 line Fix typos in docstrings. ........ ................
| * Merged revisions 80755 via svnmerge fromMark Dickinson2010-05-041-43/+83
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 77937 via svnmerge fromBenjamin Peterson2010-02-031-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/branches/py3k ................ r77937 | benjamin.peterson | 2010-02-02 20:35:45 -0600 (Tue, 02 Feb 2010) | 75 lines Merged revisions 77484,77487,77561,77570,77593,77603,77608,77667,77702-77703,77739,77858,77887,77889 via svnmerge from svn+ssh://pythondev@svn.python.org/python/trunk ........ r77484 | skip.montanaro | 2010-01-13 19:12:34 -0600 (Wed, 13 Jan 2010) | 4 lines Update PyEval_EvalFrame to PyEval_EvalFrameEx. This looks to have been done partially before. Also add a comment describing how this might have to work with different versions of the interpreter. ........ r77487 | ezio.melotti | 2010-01-14 05:34:10 -0600 (Thu, 14 Jan 2010) | 1 line Fixed typo ........ r77561 | georg.brandl | 2010-01-17 02:42:30 -0600 (Sun, 17 Jan 2010) | 1 line #7699: improve datetime docs: straightforward linking to strftime/strptime section, mark classmethods as such. ........ r77570 | georg.brandl | 2010-01-17 06:14:42 -0600 (Sun, 17 Jan 2010) | 1 line Add note about usage of STRINGLIB_EMPTY. ........ r77593 | georg.brandl | 2010-01-17 17:33:53 -0600 (Sun, 17 Jan 2010) | 1 line Fix internal reference. ........ r77603 | benjamin.peterson | 2010-01-18 17:07:56 -0600 (Mon, 18 Jan 2010) | 8 lines data descriptors do not override the class dictionary if __get__ is not defined Adjust documentation and add a test to verify this behavior. See http://mail.python.org/pipermail/python-dev/2010-January/095637.html for discussion. ........ r77608 | gregory.p.smith | 2010-01-19 02:19:03 -0600 (Tue, 19 Jan 2010) | 6 lines Do not compile stubs for the sha2 series hashes in the openssl hashlib module when the openssl version is too old to support them. That leads both compiled code bloat and to unittests attempting to test implementations that don't exist for comparison purposes on such platforms. ........ r77667 | mark.dickinson | 2010-01-21 12:32:27 -0600 (Thu, 21 Jan 2010) | 1 line Add two more test_strtod test values. ........ r77702 | georg.brandl | 2010-01-23 02:43:31 -0600 (Sat, 23 Jan 2010) | 1 line #7762: fix refcount annotation of PyUnicode_Tailmatch(). ........ r77703 | georg.brandl | 2010-01-23 02:47:54 -0600 (Sat, 23 Jan 2010) | 1 line #7725: fix referencing issue. ........ r77739 | benjamin.peterson | 2010-01-24 21:52:52 -0600 (Sun, 24 Jan 2010) | 1 line mention from_float() in error message ........ r77858 | georg.brandl | 2010-01-30 11:57:48 -0600 (Sat, 30 Jan 2010) | 1 line #7802: fix invalid example (heh). ........ r77887 | georg.brandl | 2010-01-31 12:51:49 -0600 (Sun, 31 Jan 2010) | 5 lines Fix-up ftplib documentation: move exception descriptions to toplevel, not inside a class remove attribution in "versionadded" spell and grammar check docstring of FTP_TLS ........ r77889 | michael.foord | 2010-01-31 13:59:26 -0600 (Sun, 31 Jan 2010) | 1 line Minor modification to unittest documentation. ........ ................
| * Merged revisions 77326 via svnmerge fromMark Dickinson2010-01-061-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/branches/py3k ................ r77326 | mark.dickinson | 2010-01-06 16:22:15 +0000 (Wed, 06 Jan 2010) | 9 lines Merged revisions 77324 via svnmerge from svn+ssh://pythondev@svn.python.org/python/trunk ........ r77324 | mark.dickinson | 2010-01-06 16:20:22 +0000 (Wed, 06 Jan 2010) | 2 lines Add missing docstring for Context.divmod. Thanks Juan José Conti. ........ ................
| * Merged revisions 75947 via svnmerge fromMark Dickinson2009-10-291-9/+30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 75562 via svnmerge fromMark Dickinson2009-10-201-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | svn+ssh://pythondev@www.python.org/python/branches/py3k ................ r75562 | mark.dickinson | 2009-10-20 14:38:04 +0100 (Tue, 20 Oct 2009) | 10 lines Merged revisions 75561 via svnmerge from svn+ssh://pythondev@svn.python.org/python/trunk ........ r75561 | mark.dickinson | 2009-10-20 14:33:03 +0100 (Tue, 20 Oct 2009) | 3 lines Issue #7099: Decimal.is_normal should return True for all nonzero finite non-subnormal values, even those with exponent > Emax. ........ ................
| * Merged revisions 75276 via svnmerge fromMark Dickinson2009-10-071-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | svn+ssh://pythondev@www.python.org/python/branches/py3k ................ r75276 | mark.dickinson | 2009-10-07 20:23:50 +0100 (Wed, 07 Oct 2009) | 12 lines Merged revisions 75275 via svnmerge from svn+ssh://pythondev@svn.python.org/python/trunk ........ r75275 | mark.dickinson | 2009-10-07 20:22:05 +0100 (Wed, 07 Oct 2009) | 6 lines Issue #7048: logb should round its result when that result doesn't fit into the available precision. (Tests for this change are included in the most recent set of testcases from the Decimal Specification site; those testcases will be updated shortly.) ........ ................
| * Merged revisions 74709 via svnmerge fromMark Dickinson2009-09-081-3/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 74566 via svnmerge fromMark Dickinson2009-08-281-2/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | svn+ssh://pythondev@www.python.org/python/branches/py3k ................ r74566 | mark.dickinson | 2009-08-28 14:39:53 +0100 (Fri, 28 Aug 2009) | 10 lines Merged revisions 74564 via svnmerge from svn+ssh://pythondev@svn.python.org/python/trunk ........ r74564 | mark.dickinson | 2009-08-28 14:25:02 +0100 (Fri, 28 Aug 2009) | 3 lines Issue #6794: Fix handling of NaNs in Decimal.compare_total and Decimal.compare_total_mag. ........ ................
| * Merged revisions 74279 via svnmerge fromMark Dickinson2009-08-021-17/+10
| | | | | | | | | | | | | | | | | | | | 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. ........
* | Get command-line doctest of Lib/decimal.py to work again.Raymond Hettinger2011-02-011-2/+2
| | | | | | | | | | | | | | If tested as '__main__' instead 'decimal', the tracebacks would abbreviate 'decimal.Inexact' as 'Inexact', breaking the doctests. (Reviewed by Antoine.)
* | Add link to specification.Raymond Hettinger2010-11-301-0/+1
| |
* | Replace _nbits() with int.bit_length().Raymond Hettinger2010-11-271-17/+1
| |
* | Issue #7094: Add alternate ('#') flag to __format__ methods for float, ↵Eric Smith2010-11-251-2/+3
| | | | | | | | 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-1/+2
| |
* | Issue #9136: Profiling Decimal gave 'dictionary changed size during iteration'.Mark Dickinson2010-07-081-13/+31
| | | | | | | | Remove the use of locals() that caused this error.
* | Fix misplaced exactness check that was causing unnecessary work in ↵Mark Dickinson2010-07-081-3/+4
| | | | | | | | Decimal.__pow__.
* | Fix a performance issue in Decimal.pow. Thanks Stefan Krah for finding this.Mark Dickinson2010-07-081-6/+8
| |
* | Fix mild type confusion in decimal module docstring.Mark Dickinson2010-06-121-1/+2
| |
* | Fix typo in docstring.Mark Dickinson2010-06-111-1/+1
| |
* | Issue #8188: Comparisons between Decimal objects and other numericMark Dickinson2010-06-111-6/+37
| | | | | | | | objects (Fraction, float, complex, int) now all function as expected.
* | Issue #8188: Introduce a new scheme for computing hashes of numbersMark Dickinson2010-05-231-48/+32
| | | | | | | | | | | | (instances of int, float, complex, decimal.Decimal and fractions.Fraction) that makes it easy to maintain the invariant that hash(x) == hash(y) whenever x and y have equal value.
* | #Issue 8540: Make Context._clamp attribute public in decimal module.Mark Dickinson2010-05-221-15/+39
| |
* | Merged revisions 81350 via svnmerge fromStefan Krah2010-05-191-2/+2
| | | | | | | | | | | | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/trunk ........ r81350 | stefan.krah | 2010-05-19 17:46:39 +0200 (Wed, 19 May 2010) | 1 line Fix typos in docstrings. ........
* | Merged revisions 80753 via svnmerge fromMark Dickinson2010-05-041-43/+83
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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. ........