summaryrefslogtreecommitdiff
path: root/Lib/test/test_float.py
AgeCommit message (Collapse)AuthorLines
2011-10-28bring is_integer into tested existenceBenjamin Peterson-0/+6
2011-03-16#11565: Merge with 3.1.Ezio Melotti-2/+2
2011-03-16#11565: Fix several typos. Patch by Piotr Kasprzyk.Ezio Melotti-2/+2
2010-12-04Issue #10624: Use support.requires_IEEE_754 in all appropriate tests.Eric Smith-10/+6
2010-12-04Merged revisions 87032 via svnmerge fromMark Dickinson-0/+25
svn+ssh://pythondev@svn.python.org/python/branches/py3k ........ r87032 | mark.dickinson | 2010-12-04 12:25:30 +0000 (Sat, 04 Dec 2010) | 3 lines Issue #10596: Fix float.__mod__ to have the same behaviour as float.__divmod__ with respect to signed zeros. ........
2010-12-04Backout broken backport. (Sorry.)Mark Dickinson-20/+10
2010-12-04Merged revisions 87032 via svnmerge fromMark Dickinson-0/+20
svn+ssh://pythondev@svn.python.org/python/branches/py3k ........ r87032 | mark.dickinson | 2010-12-04 12:25:30 +0000 (Sat, 04 Dec 2010) | 3 lines Issue #10596: Fix float.__mod__ to have the same behaviour as float.__divmod__ with respect to signed zeros. ........
2010-12-04Issue #10596: Fix float.__mod__ to have the same behaviour asMark Dickinson-0/+20
float.__divmod__ with respect to signed zeros.
2010-12-04Issue #10557: Fixed error messages from float() and other numericAlexander Belopolsky-1/+17
types. Added a new API function, PyUnicode_TransformDecimalToASCII(), which transforms non-ASCII decimal digits in a Unicode string to their ASCII equivalents.
2010-11-25Issue #7094: Add alternate ('#') flag to __format__ methods for float, ↵Eric Smith-5/+2
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.
2010-11-21Merged revisions 86596 via svnmerge fromEzio Melotti-5/+5
svn+ssh://pythondev@svn.python.org/python/branches/py3k ........ r86596 | ezio.melotti | 2010-11-20 21:04:17 +0200 (Sat, 20 Nov 2010) | 1 line #9424: Replace deprecated assert* methods in the Python test suite. ........
2010-11-20#9424: Replace deprecated assert* methods in the Python test suite.Ezio Melotti-3/+3
2010-10-31Merged revisions 86003 via svnmerge fromBrian Curtin-10/+11
svn+ssh://pythondev@svn.python.org/python/branches/py3k ........ r86003 | brian.curtin | 2010-10-30 19:03:45 -0500 (Sat, 30 Oct 2010) | 2 lines Fix ResourceWarning. Use context manager to properly close file. ........
2010-10-31Fix ResourceWarning. Use context manager to properly close file.Brian Curtin-10/+11
2010-08-04Issue #9337: Make float.__str__ identical to float.__repr__.Mark Dickinson-1/+3
(And similarly for complex numbers.)
2010-07-02Merged revisions 82461 via svnmerge fromBenjamin Peterson-40/+27
svn+ssh://pythondev@svn.python.org/python/trunk ........ r82461 | benjamin.peterson | 2010-07-02 18:05:27 -0500 (Fri, 02 Jul 2010) | 1 line don't require the presence of __getformat__ or __setformat__; use requires_IEEE_754 globally ........
2010-06-20Merged revisions 82117 via svnmerge fromMark Dickinson-102/+0
svn+ssh://pythondev@svn.python.org/python/trunk ........ r82117 | mark.dickinson | 2010-06-20 19:50:19 +0100 (Sun, 20 Jun 2010) | 1 line Merge test_strtod and test_float string-to-float conversion tests. ........
2010-05-23Issue #8188: Introduce a new scheme for computing hashes of numbersMark Dickinson-9/+0
(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.
2010-04-05Merged revisions 79804 via svnmerge fromMark Dickinson-0/+9
svn+ssh://pythondev@svn.python.org/python/trunk ........ r79804 | mark.dickinson | 2010-04-05 19:07:51 +0100 (Mon, 05 Apr 2010) | 5 lines Use a more robust infinity check in _Py_HashDouble. This fixes a test_decimal failure on FreeBSD 8.0. (modf apparently doesn't follow C99 Annex F on FreeBSD.) ........
2010-03-14Merged revisions 78093 via svnmerge fromGeorg Brandl-1/+0
svn+ssh://pythondev@svn.python.org/python/trunk ........ r78093 | georg.brandl | 2010-02-07 18:03:15 +0100 (So, 07 Feb 2010) | 1 line Remove unused imports in test modules. ........
2010-02-12Merged revisions 78166 via svnmerge fromMark Dickinson-0/+3
svn+ssh://pythondev@svn.python.org/python/trunk ........ r78166 | mark.dickinson | 2010-02-12 21:16:38 +0000 (Fri, 12 Feb 2010) | 1 line Check that 'd' isn't allowed as an exponent specifier in inputs to the float function. ........
2010-01-23use assert[Not]In where appropriateEzio Melotti-9/+4
2010-01-19use assert[Not]In where appropriateBenjamin Peterson-0/+5
A patch from Dave Malcolm.
2010-01-12Merged revisions 77452 via svnmerge fromMark Dickinson-0/+102
svn+ssh://pythondev@svn.python.org/python/branches/py3k ................ r77452 | mark.dickinson | 2010-01-12 23:04:19 +0000 (Tue, 12 Jan 2010) | 23 lines Merged revisions 77410,77421,77450-77451 via svnmerge from svn+ssh://pythondev@svn.python.org/python/trunk ........ r77410 | mark.dickinson | 2010-01-10 13:06:31 +0000 (Sun, 10 Jan 2010) | 1 line Remove unused BCinfo fields and an unused macro. ........ r77421 | mark.dickinson | 2010-01-11 17:15:13 +0000 (Mon, 11 Jan 2010) | 1 line Change a variable type to avoid signed overflow; replace repeated '19999' constant by a define. ........ r77450 | mark.dickinson | 2010-01-12 22:23:56 +0000 (Tue, 12 Jan 2010) | 4 lines Issue #7632: Fix a problem with _Py_dg_strtod that could lead to crashes in debug builds, for certain long numeric strings corresponding to subnormal values. ........ r77451 | mark.dickinson | 2010-01-12 22:55:51 +0000 (Tue, 12 Jan 2010) | 2 lines Issue #7632: Fix a bug in dtoa.c that could lead to incorrectly-rounded results. ........ ................
2010-01-12Merged revisions 77410,77421,77450-77451 via svnmerge fromMark Dickinson-0/+102
svn+ssh://pythondev@svn.python.org/python/trunk ........ r77410 | mark.dickinson | 2010-01-10 13:06:31 +0000 (Sun, 10 Jan 2010) | 1 line Remove unused BCinfo fields and an unused macro. ........ r77421 | mark.dickinson | 2010-01-11 17:15:13 +0000 (Mon, 11 Jan 2010) | 1 line Change a variable type to avoid signed overflow; replace repeated '19999' constant by a define. ........ r77450 | mark.dickinson | 2010-01-12 22:23:56 +0000 (Tue, 12 Jan 2010) | 4 lines Issue #7632: Fix a problem with _Py_dg_strtod that could lead to crashes in debug builds, for certain long numeric strings corresponding to subnormal values. ........ r77451 | mark.dickinson | 2010-01-12 22:55:51 +0000 (Tue, 12 Jan 2010) | 2 lines Issue #7632: Fix a bug in dtoa.c that could lead to incorrectly-rounded results. ........
2009-12-30Merged revisions 77139-77140 via svnmerge fromMark Dickinson-0/+211
svn+ssh://pythondev@svn.python.org/python/trunk ........ r77139 | mark.dickinson | 2009-12-30 12:12:23 +0000 (Wed, 30 Dec 2009) | 3 lines Issue #7534: Fix handling of nans, infinities, and negative zero in ** operator, on IEEE 754 platforms. Thanks Marcos Donolo for original patch. ........ r77140 | mark.dickinson | 2009-12-30 12:22:49 +0000 (Wed, 30 Dec 2009) | 1 line Add Marcos Donolo for work on issue 7534 patch. ........
2009-12-02Merged revisions 76632 via svnmerge fromEric Smith-0/+35
svn+ssh://pythondev@svn.python.org/python/trunk ........ r76632 | eric.smith | 2009-12-02 12:43:06 -0500 (Wed, 02 Dec 2009) | 1 line Issue #4482: Add tests for special float value formatting. ........
2009-11-24Merged revisions 76485 via svnmerge fromMark Dickinson-0/+4
svn+ssh://pythondev@www.python.org/python/branches/py3k ................ r76485 | mark.dickinson | 2009-11-24 10:59:34 +0000 (Tue, 24 Nov 2009) | 9 lines Merged revisions 76483 via svnmerge from svn+ssh://pythondev@svn.python.org/python/trunk ........ r76483 | mark.dickinson | 2009-11-24 10:54:58 +0000 (Tue, 24 Nov 2009) | 2 lines round(0, "ermintrude") succeeded instead of producing a TypeError. Fix this. ........ ................
2009-11-24Merged revisions 76483 via svnmerge fromMark Dickinson-0/+4
svn+ssh://pythondev@svn.python.org/python/trunk ........ r76483 | mark.dickinson | 2009-11-24 10:54:58 +0000 (Tue, 24 Nov 2009) | 2 lines round(0, "ermintrude") succeeded instead of producing a TypeError. Fix this. ........
2009-10-27Merged revisions 75890 via svnmerge fromMark Dickinson-1/+0
svn+ssh://pythondev@svn.python.org/python/branches/py3k ........ r75890 | mark.dickinson | 2009-10-27 23:00:56 +0000 (Tue, 27 Oct 2009) | 1 line Remove extra blank line accidentally introduced in r75885 ........
2009-10-27Remove extra blank line accidentally introduced in r75885Mark Dickinson-1/+0
2009-10-27Merged revisions 75885 via svnmerge fromMark Dickinson-0/+4
svn+ssh://pythondev@svn.python.org/python/branches/py3k ................ r75885 | mark.dickinson | 2009-10-27 22:12:20 +0000 (Tue, 27 Oct 2009) | 9 lines Merged revisions 75883 via svnmerge from svn+ssh://pythondev@svn.python.org/python/trunk ........ r75883 | mark.dickinson | 2009-10-27 22:09:33 +0000 (Tue, 27 Oct 2009) | 1 line Test long inputs to float ........ ................
2009-10-27Merged revisions 75883 via svnmerge fromMark Dickinson-0/+4
svn+ssh://pythondev@svn.python.org/python/trunk ........ r75883 | mark.dickinson | 2009-10-27 22:09:33 +0000 (Tue, 27 Oct 2009) | 1 line Test long inputs to float ........
2009-08-13Merged revisions 73715 via svnmerge fromGeorg Brandl-30/+30
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* ........
2009-06-30convert old fail* assertions to assert*Benjamin Peterson-30/+30
2009-05-20Refactor to remove duplicated nan/inf parsing code inMark Dickinson-0/+10
pystrtod.c, floatobject.c and dtoa.c.
2009-05-11Merged revisions 72564 via svnmerge fromMark Dickinson-0/+31
svn+ssh://pythondev@svn.python.org/python/trunk ........ r72564 | mark.dickinson | 2009-05-11 16:33:08 +0100 (Mon, 11 May 2009) | 2 lines Issue #5981: Fix some float.fromhex bugs related to inf and nan handling. ........
2009-05-06Issue #3382. float 'F' formatting no longer maps to 'f'. This only affects ↵Eric Smith-0/+6
nan and inf.
2009-05-05Issue #5920: Changed format.__float__ and complex.__float__ to use a ↵Eric Smith-0/+7
precision of 12 when using the empty presentation type. This more closely matches str()'s behavior and reduces surprises when adding alignment flags to an empty format string. Patch by Mark Dickinson.
2009-04-29Issue #5864: Fix problem with empty code formatting for floats,Mark Dickinson-0/+5
where a bogus trailing zero could be added.
2009-04-18Issue #1869 (and 4707, 5118, 5473, 1456775): use the newMark Dickinson-0/+83
string <-> float conversion routines to make round(x, n) correctly rounded for floats x, so that it always agrees with format(x, '.<n>f'). Also fix some other round nuisances, like round(123.456, 1-2**31) giving an integer rather than a float.
2009-04-17Sort out some confusion in test_float.py: the twoMark Dickinson-15/+12
separate FormatTestCase classes have been combined, and test_short_repr has been moved from FormatTestCase to the existing ReprTestCase.
2009-04-16The other half of Issue #1580: use short float repr where possible.Eric Smith-0/+76
Addresses the float -> string conversion, using David Gay's code which was added in Mark Dickinson's checkin r71663. Also addresses these, which are intertwined with the short repr changes: - Issue #5772: format(1e100, '<') produces '1e+100', not '1.0e+100' - Issue #5515: 'n' formatting with commas no longer works poorly with leading zeros. - PEP 378 Format Specifier for Thousands Separator: implemented for floats.
2009-04-15Merged revisions 71627 via svnmerge fromBenjamin Peterson-0/+7
svn+ssh://pythondev@svn.python.org/python/trunk ........ r71627 | benjamin.peterson | 2009-04-15 16:26:36 -0500 (Wed, 15 Apr 2009) | 4 lines call __float__ on str subclasses #5759 tests by R. David Murray ........
2008-11-12Issue #4296: Fix PyObject_RichCompareBool so that "x in [x]" evaluates toMark Dickinson-0/+27
True, even when x doesn't compare equal to itself. This was a regression from 2.6. Reviewed by R. Hettinger and C. Heimes.
2008-09-06Merged revisions 66277 via svnmerge fromBenjamin Peterson-1/+1
svn+ssh://pythondev@svn.python.org/python/trunk ........ r66277 | benjamin.peterson | 2008-09-06 18:19:15 -0500 (Sat, 06 Sep 2008) | 1 line fix missing module ........
2008-09-06I modified the tests a bit to account for unicode stringAmaury Forgeot d'Arc-4/+4
Merged revisions 66270 via svnmerge from svn+ssh://pythondev@svn.python.org/python/trunk ........ r66270 | amaury.forgeotdarc | 2008-09-06 22:53:51 +0200 (sam., 06 sept. 2008) | 3 lines #3796: A test class was not run in test_float. Reviewed by Benjamin. ........
2008-08-21Merged revisions 65958 via svnmerge fromMark Dickinson-1/+7
svn+ssh://pythondev@svn.python.org/python/trunk ........ r65958 | mark.dickinson | 2008-08-21 21:02:24 +0100 (Thu, 21 Aug 2008) | 5 lines Fix float.fromhex test to give additional information on failure. This change is aimed at diagnosing issue 3633 (test_float fails on Solaris). Reviewed by Benjamin Peterson ........
2008-07-16Merged revisions ↵Georg Brandl-1/+17
64722,64729,64753,64845-64846,64849,64871,64880-64882,64885,64888,64897,64900-64901,64915,64926-64929,64938-64941,64944,64961,64966,64973 via svnmerge from svn+ssh://pythondev@svn.python.org/python/trunk ........ r64722 | georg.brandl | 2008-07-05 12:13:36 +0200 (Sat, 05 Jul 2008) | 4 lines #2663: support an *ignore* argument to shutil.copytree(). Patch by Tarek Ziade. This is a new feature, but Barry authorized adding it in the beta period. ........ r64729 | mark.dickinson | 2008-07-05 13:33:52 +0200 (Sat, 05 Jul 2008) | 5 lines Issue 3188: accept float('infinity') as well as float('inf'). This makes the float constructor behave in the same way as specified by various other language standards, including C99, IEEE 754r, and the IBM Decimal standard. ........ r64753 | gregory.p.smith | 2008-07-06 05:35:58 +0200 (Sun, 06 Jul 2008) | 4 lines - Issue #2862: Make int and float freelist management consistent with other freelists. Changes their CompactFreeList apis into ClearFreeList apis and calls them via gc.collect(). ........ r64845 | raymond.hettinger | 2008-07-10 16:03:19 +0200 (Thu, 10 Jul 2008) | 1 line Issue 3301: Bisect functions behaved badly when lo was negative. ........ r64846 | raymond.hettinger | 2008-07-10 16:34:57 +0200 (Thu, 10 Jul 2008) | 1 line Issue 3285: Fractions from_float() and from_decimal() accept Integral arguments. ........ r64849 | andrew.kuchling | 2008-07-10 16:43:31 +0200 (Thu, 10 Jul 2008) | 1 line Wording changes ........ r64871 | raymond.hettinger | 2008-07-11 14:00:21 +0200 (Fri, 11 Jul 2008) | 1 line Add cautionary note on the use of PySequence_Fast_ITEMS. ........ r64880 | amaury.forgeotdarc | 2008-07-11 23:28:25 +0200 (Fri, 11 Jul 2008) | 5 lines #3317 in zipfile module, restore the previous names of global variables: some applications relied on them. Also remove duplicated lines. ........ r64881 | amaury.forgeotdarc | 2008-07-11 23:45:06 +0200 (Fri, 11 Jul 2008) | 3 lines #3342: In tracebacks, printed source lines were not indented since r62555. #3343: Py_DisplaySourceLine should be a private function. Rename it to _Py_DisplaySourceLine. ........ r64882 | josiah.carlson | 2008-07-12 00:17:14 +0200 (Sat, 12 Jul 2008) | 2 lines Fix for the AttributeError in test_asynchat. ........ r64885 | josiah.carlson | 2008-07-12 01:26:59 +0200 (Sat, 12 Jul 2008) | 2 lines Fixed test for asyncore. ........ r64888 | matthias.klose | 2008-07-12 09:51:48 +0200 (Sat, 12 Jul 2008) | 2 lines - Fix bashisms in Tools/faqwiz/move-faqwiz.sh ........ r64897 | benjamin.peterson | 2008-07-12 22:16:19 +0200 (Sat, 12 Jul 2008) | 1 line fix various doc typos #3320 ........ r64900 | alexandre.vassalotti | 2008-07-13 00:06:53 +0200 (Sun, 13 Jul 2008) | 2 lines Fixed typo. ........ r64901 | benjamin.peterson | 2008-07-13 01:41:19 +0200 (Sun, 13 Jul 2008) | 1 line #1778443 robotparser fixes from Aristotelis Mikropoulos ........ r64915 | nick.coghlan | 2008-07-13 16:52:36 +0200 (Sun, 13 Jul 2008) | 1 line Fix issue 3221 by emitting a RuntimeWarning instead of raising SystemError when the parent module can't be found during an absolute import (likely due to non-PEP 361 aware code which sets a module level __package__ attribute) ........ r64926 | martin.v.loewis | 2008-07-13 22:31:49 +0200 (Sun, 13 Jul 2008) | 2 lines Add turtle into the module index. ........ r64927 | alexandre.vassalotti | 2008-07-13 22:42:44 +0200 (Sun, 13 Jul 2008) | 3 lines Issue #3274: Use a less common identifier for the temporary variable in Py_CLEAR(). ........ r64928 | andrew.kuchling | 2008-07-13 23:43:25 +0200 (Sun, 13 Jul 2008) | 1 line Re-word ........ r64929 | andrew.kuchling | 2008-07-13 23:43:52 +0200 (Sun, 13 Jul 2008) | 1 line Add various items; move ctypes items into a subsection of their own ........ r64938 | andrew.kuchling | 2008-07-14 02:35:32 +0200 (Mon, 14 Jul 2008) | 1 line Typo fixes ........ r64939 | andrew.kuchling | 2008-07-14 02:40:55 +0200 (Mon, 14 Jul 2008) | 1 line Typo fix ........ r64940 | andrew.kuchling | 2008-07-14 03:18:16 +0200 (Mon, 14 Jul 2008) | 1 line Typo fix ........ r64941 | andrew.kuchling | 2008-07-14 03:18:31 +0200 (Mon, 14 Jul 2008) | 1 line Expand the multiprocessing section ........ r64944 | gregory.p.smith | 2008-07-14 08:06:48 +0200 (Mon, 14 Jul 2008) | 7 lines Fix posix.fork1() / os.fork1() to only call PyOS_AfterFork() in the child process rather than both parent and child. Does anyone actually use fork1()? It appears to be a Solaris thing but if Python is built with pthreads on Solaris, fork1() and fork() should be the same. ........ r64961 | jesse.noller | 2008-07-15 15:47:33 +0200 (Tue, 15 Jul 2008) | 1 line multiprocessing/connection.py patch to remove fqdn oddness for issue 3270 ........ r64966 | nick.coghlan | 2008-07-15 17:40:22 +0200 (Tue, 15 Jul 2008) | 1 line Add missing NEWS entry for r64962 ........ r64973 | jesse.noller | 2008-07-15 20:29:18 +0200 (Tue, 15 Jul 2008) | 1 line Revert 3270 patch: self._address is in pretty widespread use, need to revisit ........
2008-07-16Merged revisions 64981 via svnmerge fromMark Dickinson-4/+4
svn+ssh://pythondev@svn.python.org/python/trunk ........ r64981 | mark.dickinson | 2008-07-15 22:55:23 +0100 (Tue, 15 Jul 2008) | 4 lines Fix float.from_hex tests. It appears that Linux/ia64 doesn't like computing 2.0**-1074 accurately. Using ldexp(1.0, -1074) should be safer. ........