summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_math.py
Commit message (Collapse)AuthorAgeFilesLines
* Rework integer overflow path in math.prod and add more tests (GH-11809)Pablo Galindo2019-03-091-35/+86
| | | | | The overflow check was relying on undefined behaviour as it was using the result of the multiplication to do the check, and once the overflow has already happened, any operation on the result is undefined behaviour. Some extra checks that exercise code paths related to this are also added.
* Fix division by 0 when checking for overflow in math.prod (GH-11808)Pablo Galindo2019-02-101-0/+4
|
* bpo-35606: Implement math.prod (GH-11359)Pablo Galindo2019-02-071-0/+31
|
* Fast path for int inputs to math.dist() and math.hypot() (GH-11692)Raymond Hettinger2019-01-281-1/+10
|
* bpo-34838: Use subclass_of for math.dist. (GH-9659)Ammar Askar2019-01-121-0/+2
| | | | | Argument clinic now generates fast inline code for positional parsing, so the manually implemented type check in math.dist can be removed.
* closes bpo-34640: Remove the TANH_PRESERVES_ZERO_SIGN configure check. (GH-9206)Benjamin Peterson2018-09-121-2/+0
|
* bpo-33083 - Make math.factorial reject arguments that are not int-like (GH-6149)Pablo Galindo2018-09-031-0/+5
| | | math.factorial() was accepting non-integral Decimal instances. This is inconsistent with the actual behaviour for floats, which are not accepted.
* Add more tests and assertions for math.hypot() and math.dist() (GH-8747)Raymond Hettinger2018-08-121-5/+12
|
* bpo-33089: Add math.dist() for computing the Euclidean distance between two ↵Raymond Hettinger2018-07-311-0/+103
| | | | points (GH-8561)
* bpo-33089: Multidimensional math.hypot() (GH-8474)Raymond Hettinger2018-07-281-10/+66
|
* 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 ........