summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_math.py
Commit message (Collapse)AuthorAgeFilesLines
* bpo-29962: add math.remainder (#950)Mark Dickinson2017-04-051-0/+135
| | | | | | | | | | | | | | * Implement math.remainder. * Fix markup for arguments; use double spaces after period. * Mark up function reference in what's new entry. * Add comment explaining the calculation in the final branch. * Fix out-of-order entry in whatsnew. * Add comment explaining why it's good enough to compare m with c, in spite of possible rounding error.
* Issue #29282: Backed out changeset b33012ef1417Mark Dickinson2017-01-211-234/+0
|
* Issue #29282: add fused multiply-add function, math.fma.Mark Dickinson2017-01-211-0/+234
|
* Issue #27427: Additional tests for the math module. Thanks Francisco Couzo.Mark Dickinson2016-09-041-6/+22
|
* Issue #27953: skip failing math and cmath tests for tan on OS X 10.4.Mark Dickinson2016-09-041-1/+18
|
* Issue #26040: Improve test_math and test_cmath coverage and rigour. Thanks ↵Mark Dickinson2016-09-031-87/+178
| | | | Jeff Allen.
* Issue #12345: Add mathemathcal constant tau to math and cmath.Guido van Rossum2016-08-151-0/+1
| | | | Patch by Lisa Roach. See also PEP 628.
* Issue #27626: Merge spelling fixes from 3.5Martin Panter2016-07-281-2/+2
|\
| * Issue #27626: Spelling fixes in docs, comments and internal namesMartin Panter2016-07-281-2/+2
| | | | | | | | Based on patch by Ville Skyttä.
* | Issue #23277: Remove unused imports in tests.Serhiy Storchaka2016-04-241-1/+0
|/
* Issue #19543: Implementation of isclose as per PEP 485Tal Einat2015-05-311-0/+121
| | | | | | | | | For details, see: PEP 0485 -- A Function for testing approximate equality Functions added: math.isclose() and cmath.isclose(). Original code by Chris Barker. Patch by Tal Einat.
* Issue #22486: Added the math.gcd() function. The fractions.gcd() function ↵Serhiy Storchaka2015-05-121-0/+51
| | | | | | now is deprecated. Based on patch by Mark Dickinson.
* Issue #23185: add math.inf and math.nan constants.Mark Dickinson2015-01-111-0/+11
|
* Issue #20539: Improve math.factorial error messages and types for large inputs.Mark Dickinson2014-04-101-2/+10
| | | | | - Better message for the OverflowError in large positive inputs. - Changed exception type from OverflowError to ValueError for large negative inputs.
* Issue #18702: All skipped tests now reported as skipped.Serhiy Storchaka2013-11-031-31/+30
|
* (Merge 3.2) Close #12230: Mac OS X Tiger (10.4) has a kernel bug: sometimes,Victor Stinner2011-06-011-3/+2
|\ | | | | | | | | | | | | | | | | the file descriptor of a pipe closed in the parent process is valid in the child process according to fstat(), but the mode of the file descriptor is invalid, and read or write raise an error. test.support.requires_mac_ver() is now a decorator, as suggested by Ezio Melotti, and its docstring is fixed (linux_version => mac_ver).
* | test.support: add requires_mac_ver() functionVictor Stinner2011-06-011-3/+4
| | | | | | | | Add also linux_version() to __all__.
* | Issue #11888: skip some log2 tests on Mac OS X TigerVictor Stinner2011-05-101-4/+11
| | | | | | | | System log2() is not accurate for exact power of 2.
* | Issue #11188: In log2 tests, create powers of 2 using ldexp(1, n) instead of ↵Mark Dickinson2011-05-091-2/+2
| | | | | | | | the less reliable 2.0**n.
* | Issue #11888: Add log2 function to math module. Patch written by MarkVictor Stinner2011-05-081-0/+22
| | | | | | | | Dickinson.
* | test_math.py: Use correct signs on zeros for expected fmod results.Mark Dickinson2011-05-031-6/+6
| |
* | Remove an unused import and an unused local definition from test_math.py.Mark Dickinson2011-05-031-2/+0
|/
* #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 86596 via svnmerge fromEzio Melotti2010-11-211-59/+59
| | | | | | | | | | | | | | | | | | | | 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 81127 via svnmerge fromMark Dickinson2010-05-121-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/branches/py3k ................ r81127 | mark.dickinson | 2010-05-12 20:54:51 +0100 (Wed, 12 May 2010) | 9 lines Merged revisions 81126 via svnmerge from svn+ssh://pythondev@svn.python.org/python/trunk ........ r81126 | mark.dickinson | 2010-05-12 20:53:36 +0100 (Wed, 12 May 2010) | 1 line Fix unused variable in test_factorial. ........ ................
| * Merged revisions 78045 via svnmerge fromMark Dickinson2010-02-061-25/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/branches/py3k ................ r78045 | mark.dickinson | 2010-02-06 23:16:50 +0000 (Sat, 06 Feb 2010) | 9 lines Merged revisions 78041 via svnmerge from svn+ssh://pythondev@svn.python.org/python/trunk ........ r78041 | mark.dickinson | 2010-02-06 23:11:25 +0000 (Sat, 06 Feb 2010) | 1 line testCopysign was defined twice in test_math; combine the definitions ........ ................
| * Merged revisions 73715 via svnmerge fromGeorg Brandl2009-08-131-74/+74
| | | | | | | | | | | | | | | | | | | | 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* ........
* | Issue #10624: Move requires_IEEE_754 into test.support. I'll fix up other ↵Eric Smith2010-12-041-6/+1
| | | | | | | | uses of it shortly.
* | #9424: Replace deprecated assert* methods in the Python test suite.Ezio Melotti2010-11-201-56/+56
| |
* | Issue #10337: skip tests of tanh() sign in test_math and test_cmath if tanh()Victor Stinner2010-11-071-6/+10
| | | | | | | | doesn't preserve the zero sign (if TANH_PRESERVES_ZERO_SIGN define is 0).
* | Issue #9599: Further accuracy tweaks to loghelper. For an integer n that's ↵Mark Dickinson2010-09-291-2/+9
| | | | | | | | small enough to be converted to a float without overflow, log(n) is now computed as log(float(n)), and similarly for log10.
* | Issue #9165: Add math.isfinite and cmath.isfinite.Mark Dickinson2010-07-111-0/+9
| |
* | Issue #9186: log1p(-1.0) should raise ValueError, not OverflowError.Mark Dickinson2010-07-071-8/+0
| |
* | looking up on the type is correct, so this isn't an XXXBenjamin Peterson2010-07-051-7/+0
| |
* | Merged revisions 81967 via svnmerge fromMark Dickinson2010-06-131-0/+9
| | | | | | | | | | | | | | | | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/trunk ........ r81967 | mark.dickinson | 2010-06-13 11:50:29 +0100 (Sun, 13 Jun 2010) | 4 lines Issue #8986: erfc was raising OverflowError on Linux for arguments in the (approximate) range (-27.3, 30.0), as a result of an escaped errno value. ........
* | Issue #8692: Improve performance of math.factorial:Mark Dickinson2010-05-151-10/+61
| | | | | | | | | | | | | | | | | | | | | | | | | | (1) use a different algorithm that roughly halves the total number of multiplications required and results in more balanced multiplications (2) use a lookup table for small arguments (3) fast accumulation of products in C integer arithmetic rather than PyLong arithmetic when possible. Typical speedup, from unscientific testing on a 64-bit laptop, is 4.5x to 6.5x for arguments in the range 100 - 10000. Patch by Daniel Stutzbach; extensive reviews by Alexander Belopolsky.
* | Merged revisions 81126 via svnmerge fromMark Dickinson2010-05-121-1/+1
| | | | | | | | | | | | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/trunk ........ r81126 | mark.dickinson | 2010-05-12 20:53:36 +0100 (Wed, 12 May 2010) | 1 line Fix unused variable in test_factorial. ........
* | Merged revisions 78041 via svnmerge fromMark Dickinson2010-02-061-25/+24
| | | | | | | | | | | | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/trunk ........ r78041 | mark.dickinson | 2010-02-06 23:11:25 +0000 (Sat, 06 Feb 2010) | 1 line testCopysign was defined twice in test_math; combine the definitions ........
* | Merged revisions 76861 via svnmerge fromMark Dickinson2009-12-161-7/+6
| | | | | | | | | | | | | | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/trunk ........ r76861 | mark.dickinson | 2009-12-16 20:13:40 +0000 (Wed, 16 Dec 2009) | 3 lines Issue #3366: Add expm1 function to math module. Thanks Eric Smith for testing on Windows. ........
* | Merged revisions 76755 via svnmerge fromMark Dickinson2009-12-111-5/+45
| | | | | | | | | | | | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/trunk ........ r76755 | mark.dickinson | 2009-12-11 17:29:33 +0000 (Fri, 11 Dec 2009) | 2 lines Issue #3366: Add lgamma function to math module. ........
* | Merged revisions 75454 via svnmerge fromMark Dickinson2009-10-171-1/+1
| | | | | | | | | | | | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/trunk ........ r75454 | mark.dickinson | 2009-10-17 08:06:37 +0100 (Sat, 17 Oct 2009) | 1 line test_math ulp computation was wrong on big-endian systems ........
* | Merged revisions 75157 via svnmerge fromMark Dickinson2009-09-301-1/+1
| | | | | | | | | | | | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/trunk ........ r75157 | mark.dickinson | 2009-09-30 17:58:01 +0100 (Wed, 30 Sep 2009) | 1 line Fix buggy accuracy test ........
* | Merged revisions 75117 via svnmerge fromMark Dickinson2009-09-281-0/+88
| | | | | | | | | | | | | | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/trunk ........ r75117 | mark.dickinson | 2009-09-28 19:54:55 +0100 (Mon, 28 Sep 2009) | 3 lines Issue #3366: Add gamma function to math module. (lgamma, erf and erfc to follow). ........
* | Merged revisions 74925 via svnmerge fromMark Dickinson2009-09-181-31/+34
| | | | | | | | | | | | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/trunk ........ r74925 | mark.dickinson | 2009-09-18 22:01:50 +0100 (Fri, 18 Sep 2009) | 2 lines Use skipUnless to skip math module tests on non-IEEE 754 platforms. ........
* | convert old fail* assertions to assert*Benjamin Peterson2009-06-301-74/+74
|/
* Merged revisions 71837-71838 via svnmerge fromMark Dickinson2009-04-241-8/+9
| | | | | | | | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/trunk ........ r71837 | mark.dickinson | 2009-04-24 17:34:14 +0100 (Fri, 24 Apr 2009) | 4 lines Issue #5593: Use more robust test for double-rounding in test_fsum. While we're at it, use new unittest.skipUnless decorator to implement skipping for that test. ........ r71838 | mark.dickinson | 2009-04-24 17:37:22 +0100 (Fri, 24 Apr 2009) | 2 lines Remove unnecessary double negative ........
* Merged revisions 65258,65292,65299,65308-65309,65315,65326 via svnmerge fromMark Dickinson2008-08-011-152/+96
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/trunk ........ r65258 | mark.dickinson | 2008-07-27 08:15:29 +0100 (Sun, 27 Jul 2008) | 4 lines Remove math.sum tests related to overflow, special values, and behaviour near the extremes of the floating-point range. (The behaviour of math.sum should be regarded as undefined in these cases.) ........ r65292 | mark.dickinson | 2008-07-29 19:45:38 +0100 (Tue, 29 Jul 2008) | 4 lines More modifications to tests for math.sum: replace the Python version of msum by a version using a different algorithm, and use the new float.fromhex method to specify test results exactly. ........ r65299 | mark.dickinson | 2008-07-30 13:01:41 +0100 (Wed, 30 Jul 2008) | 5 lines Fix special-value handling for math.sum. Also minor cleanups to the code: fix tabbing, remove trailing whitespace, and reformat to fit into 80 columns. ........ r65308 | mark.dickinson | 2008-07-30 17:20:10 +0100 (Wed, 30 Jul 2008) | 2 lines Rename math.sum to math.fsum ........ r65309 | mark.dickinson | 2008-07-30 17:25:16 +0100 (Wed, 30 Jul 2008) | 3 lines Replace math.sum with math.fsum in a couple of comments that were missed by r65308 ........ r65315 | mark.dickinson | 2008-07-30 21:23:15 +0100 (Wed, 30 Jul 2008) | 2 lines Add note about problems with math.fsum on x86 hardware. ........ r65326 | mark.dickinson | 2008-07-31 15:48:32 +0100 (Thu, 31 Jul 2008) | 2 lines Rename testSum to testFsum and move it to proper place in test_math.py ........
* Merged revisions ↵Georg Brandl2008-06-101-0/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 64002-64003,64012,64036-64037,64047,64050-64052,64054-64055,64066,64071 via svnmerge from svn+ssh://pythondev@svn.python.org/python/trunk ........ r64002 | travis.oliphant | 2008-06-07 00:33:21 +0200 (Sat, 07 Jun 2008) | 1 line Add long double check support to configure test. ........ r64003 | travis.oliphant | 2008-06-07 00:39:47 +0200 (Sat, 07 Jun 2008) | 1 line Remove locking part of new buffer protocol. ........ r64012 | facundo.batista | 2008-06-07 15:36:36 +0200 (Sat, 07 Jun 2008) | 4 lines Finished bug #2451. Fixed the retrying part to make it more robust. ........ r64036 | georg.brandl | 2008-06-08 10:54:40 +0200 (Sun, 08 Jun 2008) | 2 lines #3028: tokenize passes the physical line. ........ r64037 | georg.brandl | 2008-06-08 10:59:38 +0200 (Sun, 08 Jun 2008) | 2 lines Argh, I read it wrong. Reverted 64036 and added a clarifying remark. ........ r64047 | raymond.hettinger | 2008-06-09 03:28:30 +0200 (Mon, 09 Jun 2008) | 1 line Issue3065: Fixed pickling of named tuples. Added tests. ........ r64050 | raymond.hettinger | 2008-06-09 08:54:45 +0200 (Mon, 09 Jun 2008) | 1 line Issue #2138: Add math.factorial(). ........ r64051 | raymond.hettinger | 2008-06-09 10:33:37 +0200 (Mon, 09 Jun 2008) | 1 line Let set.union() and set.update() accept multiple inputs. ........ r64052 | raymond.hettinger | 2008-06-09 11:29:17 +0200 (Mon, 09 Jun 2008) | 1 line Address double-rounding scenarios by setting all variables to long doubles. ........ r64054 | raymond.hettinger | 2008-06-09 13:24:47 +0200 (Mon, 09 Jun 2008) | 1 line Unhappy buildbots. Revert 64052. Long doubles have unexpected effects on some builds. ........ r64055 | raymond.hettinger | 2008-06-09 15:07:27 +0200 (Mon, 09 Jun 2008) | 1 line Let set.intersection() and set.intersection_update() take multiple input arguments. ........ r64066 | robert.schuppenies | 2008-06-10 12:10:31 +0200 (Tue, 10 Jun 2008) | 2 lines Issue 3048: Fixed sys.getsizeof for unicode objects. ........ r64071 | thomas.heller | 2008-06-10 16:07:12 +0200 (Tue, 10 Jun 2008) | 3 lines NEWS entry for: Add an optional 'offset' parameter to byref, defaulting to zero. ........
* Merged revisions ↵Georg Brandl2008-06-101-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 63562,63570,63728,63734,63784,63788,63802,63817,63827,63839,63887,63975,63998 via svnmerge from svn+ssh://pythondev@svn.python.org/python/trunk ........ r63562 | martin.v.loewis | 2008-05-23 17:06:50 +0200 (Fri, 23 May 2008) | 2 lines Patch #1722225: Support QNX 6. ........ r63570 | trent.nelson | 2008-05-23 22:33:14 +0200 (Fri, 23 May 2008) | 1 line Introduce a user macro named $(externalsDir), which should point to the root directory of where all the external sources should live. Developers can change this value if their external sources live elsewhere. The default of '..\..' matches the current status quo. ........ r63728 | gregory.p.smith | 2008-05-26 23:16:34 +0200 (Mon, 26 May 2008) | 4 lines Fix issue2589: there was a potential integer overflow leading to memory corruption on esoteric platforms and incorrect behavior on normal platforms. ........ r63734 | gregory.p.smith | 2008-05-27 00:07:28 +0200 (Tue, 27 May 2008) | 3 lines Fix issue2588: Do not execute str[size-1] = '\0' when a 0 size is passed in. (The assert won't prevent this in non-debug builds). ........ r63784 | raymond.hettinger | 2008-05-29 10:38:23 +0200 (Thu, 29 May 2008) | 1 line Fix two typos. ........ r63788 | facundo.batista | 2008-05-29 18:39:26 +0200 (Thu, 29 May 2008) | 6 lines Fixed the semantic of timeout for socket.create_connection and all the upper level libraries that use it, including urllib2. Added and fixed some tests, and changed docs correspondingly. Thanks to John J Lee for the patch and the pusing, :) ........ r63802 | mark.dickinson | 2008-05-30 04:46:53 +0200 (Fri, 30 May 2008) | 2 lines Fix typo in testSum ........ r63817 | raymond.hettinger | 2008-05-30 20:20:50 +0200 (Fri, 30 May 2008) | 8 lines * Mark intermedidate computes values (hi, lo, yr) as volatile. * Expand comments. * Swap variable names in the sum_exact code so that x and y are consistently chosen as the larger and smaller magnitude values respectively. ........ r63827 | raymond.hettinger | 2008-05-31 05:24:31 +0200 (Sat, 31 May 2008) | 1 line Implement heapq in terms of less-than (to match list.sort()). ........ r63839 | gerhard.haering | 2008-05-31 23:33:27 +0200 (Sat, 31 May 2008) | 2 lines Fixed rowcount for SELECT statements. They're -1 now (again), for better DB-API 2.0 compliance. ........ r63887 | gregory.p.smith | 2008-06-02 06:05:52 +0200 (Mon, 02 Jun 2008) | 4 lines Fix issue 2782: be less strict about the format string type in strftime. Accept unicode and anything else ParseTuple "s#" can deal with. This matches the time.strftime behavior. ........ r63975 | neal.norwitz | 2008-06-06 06:47:01 +0200 (Fri, 06 Jun 2008) | 3 lines Aldo Cortesi confirmed this is still needed for OpenBSD 4.2 and 4.3. (I didn't regen configure, since I don't have a working autoconf.) ........ r63998 | raymond.hettinger | 2008-06-06 23:47:51 +0200 (Fri, 06 Jun 2008) | 1 line Issue 3501: Make heapq support both __le__ and __lt__. ........