summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_math.py
Commit message (Collapse)AuthorAgeFilesLines
* bpo-32297: Few misspellings found in Python source code comments. (#4803)Mike2017-12-141-1/+1
| | | | | | | | * Fix multiple typos in code comments * Add spacing in comments (test_logging.py, test_math.py) * Fix spaces at the beginning of comments in test_logging.py
* 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. ........