summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_float.py
Commit message (Collapse)AuthorAgeFilesLines
* bpo-34087: Fix buffer overflow in int(s) and similar functions (GH-8274)INADA Naoki2018-07-141-0/+3
| | | | | | `_PyUnicode_TransformDecimalAndSpaceToASCII()` missed trailing NUL char. It caused buffer overflow in `_Py_string_to_number_with_underscores()`. This bug is introduced in 9b6c60cb.
* bpo-31979: Simplify transforming decimals to ASCII (#4336)Serhiy Storchaka2017-11-131-1/+1
| | | | | in int(), float() and complex() parsers. This also speeds up parsing non-ASCII numbers by around 20%.
* bpo-31373: remove overly strict float range checks (#3486)Benjamin Peterson2017-09-111-0/+6
| | | | | This undoes a853a8ba7850381d49b284295dd6f0dc491dbe44 except for the pytime.c parts. We want to continue to allow IEEE 754 doubles larger than FLT_MAX to be rounded into finite floats. Tests were added to very this behavior.
* bpo-29773: Add more cases for testing string to float conversion errors. (#580)Serhiy Storchaka2017-03-091-8/+20
|
* bpo-29695: Remove bad keyword parameters in int(), bool(), float(), list() ↵Serhiy Storchaka2017-03-061-2/+2
| | | | and tuple(). (#518)
* bpo-29695: Deprecated using bad named keyword arguments in builtings: (#486)Serhiy Storchaka2017-03-051-0/+4
| | | | int(), bool(), float(), list() and tuple(). Specify the value as a positional argument instead.
* Issue #26331: Implement the parsing part of PEP 515.Brett Cannon2016-09-091-1/+23
| | | | Thanks to Georg Brandl for the patch.
* Issue #26983: float() now always return an instance of exact float.Serhiy Storchaka2016-06-031-8/+13
| | | | | | The deprecation warning is emitted if __float__ returns an instance of a strict subclass of float. In a future versions of Python this can be an error.
* Issue #23640: int.from_bytes() no longer bypasses constructors for subclasses.Serhiy Storchaka2016-05-121-0/+18
|\
| * Issue #23640: int.from_bytes() no longer bypasses constructors for subclasses.Serhiy Storchaka2016-05-121-0/+18
| |
* | Issue #23277: Remove unused imports in tests.Serhiy Storchaka2016-04-241-1/+0
|/
* Issue #24731: Fixed crash on converting objects with special methodsSerhiy Storchaka2015-11-251-0/+15
|\ | | | | | | | | __bytes__, __trunc__, and __float__ returning instances of subclasses of bytes, int, and float to subclasses of bytes, int, and float correspondingly.
| * Issue #24731: Fixed crash on converting objects with special methodsSerhiy Storchaka2015-11-251-0/+15
| | | | | | | | | | __bytes__, __trunc__, and __float__ returning instances of subclasses of bytes, int, and float to subclasses of bytes, int, and float correspondingly.
* | Issue #24802: Merge null termination fixes from 3.4 into 3.5Martin Panter2015-11-071-2/+36
|\ \ | |/
| * Issue #24802: Copy bytes-like objects to null-terminated buffers if necessaryMartin Panter2015-11-071-2/+36
| | | | | | | | | | | | | | | | This avoids possible buffer overreads when int(), float(), compile(), exec() and eval() are passed bytes-like objects. Similar code is removed from the complex() constructor, where it was not reachable. Patch by John Leitch, Serhiy Storchaka and Martin Panter.
* | Issue 19933: Provide default argument for ndigits in round. Patch by ↵Steve Dower2015-04-151-0/+8
| | | | | | | | Vajrasky Kok.
* | Issue #21741: Update 147 test modules to use test discovery.Zachary Ware2015-04-131-14/+1
|/ | | | | | | I have compared output between pre- and post-patch runs of these tests to make sure there's nothing missing and nothing broken, on both Windows and Linux. The only differences I found were actually tests that were previously *not* run.
* fix up import styleBenjamin Peterson2015-03-091-5/+8
|
* remove redundant testBenjamin Peterson2015-03-061-5/+0
|
* fix potential refleak in PyFloat_AsDouble (closes #23590)Benjamin Peterson2015-03-061-0/+6
|
* Issue 19572: More silently skipped tests explicitly skipped.Zachary Ware2013-12-081-1/+1
|\
| * Issue 19572: More silently skipped tests explicitly skipped.Zachary Ware2013-12-081-1/+1
| |
* | #17080: improve error message of float/complex when the wrong type is passed.Ezio Melotti2013-11-071-0/+1
|/
* Remove untests for non-existent functionality.Mark Dickinson2012-04-291-10/+0
|
* Issue #14521: Make result of float('nan') and float('-nan') more consistent ↵Mark Dickinson2012-04-291-0/+13
| | | | across platforms. Further, don't rely on Py_HUGE_VAL for float('inf').
* merge 3.2Benjamin Peterson2011-10-281-0/+6
|\
| * bring is_integer into tested existenceBenjamin Peterson2011-10-281-0/+6
| |
* | #11565: Merge with 3.2.Ezio Melotti2011-03-161-2/+2
|\ \ | |/
| * #11565: Merge with 3.1.Ezio Melotti2011-03-161-2/+2
| |\
| | * #11565: Fix several typos. Patch by Piotr Kasprzyk.Ezio Melotti2011-03-161-2/+2
| | |
| | * Merged revisions 87032 via svnmerge fromMark Dickinson2010-12-041-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. ........
| | * Backout broken backport. (Sorry.)Mark Dickinson2010-12-041-20/+10
| | |
| | * Merged revisions 87032 via svnmerge fromMark Dickinson2010-12-041-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. ........
| | * Merged revisions 86596 via svnmerge fromEzio Melotti2010-11-211-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. ........
| | * Merged revisions 86003 via svnmerge fromBrian Curtin2010-10-311-11/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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. ........
| | * Merged revisions 77452 via svnmerge fromMark Dickinson2010-01-121-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. ........ ................
| | * Merged revisions 76485 via svnmerge fromMark Dickinson2009-11-241-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. ........ ................
| | * Merged revisions 75890 via svnmerge fromMark Dickinson2009-10-271-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 ........
| | * Merged revisions 75885 via svnmerge fromMark Dickinson2009-10-271-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 ........ ................
| | * Merged revisions 73715 via svnmerge fromGeorg Brandl2009-08-131-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* ........
* | | Removed fcmp and FUZZ from test.support, following the discussion on python-dev:Eli Bendersky2011-02-251-1/+1
|/ / | | | | | | http://mail.python.org/pipermail/python-dev/2011-January/107735.html
* | Issue #10624: Use support.requires_IEEE_754 in all appropriate tests.Eric Smith2010-12-041-10/+6
| |
* | Issue #10596: Fix float.__mod__ to have the same behaviour asMark Dickinson2010-12-041-0/+20
| | | | | | | | float.__divmod__ with respect to signed zeros.
* | Issue #10557: Fixed error messages from float() and other numericAlexander Belopolsky2010-12-041-1/+17
| | | | | | | | | | | | types. Added a new API function, PyUnicode_TransformDecimalToASCII(), which transforms non-ASCII decimal digits in a Unicode string to their ASCII equivalents.
* | Issue #7094: Add alternate ('#') flag to __format__ methods for float, ↵Eric Smith2010-11-251-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.
* | #9424: Replace deprecated assert* methods in the Python test suite.Ezio Melotti2010-11-201-3/+3
| |
* | Fix ResourceWarning. Use context manager to properly close file.Brian Curtin2010-10-311-11/+12
| |
* | Issue #9337: Make float.__str__ identical to float.__repr__.Mark Dickinson2010-08-041-1/+3
| | | | | | | | (And similarly for complex numbers.)
* | Merged revisions 82461 via svnmerge fromBenjamin Peterson2010-07-021-42/+29
| | | | | | | | | | | | | | | | | | | | 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 ........
* | Merged revisions 82117 via svnmerge fromMark Dickinson2010-06-201-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. ........