summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_math.py
Commit message (Collapse)AuthorAgeFilesLines
* Rename testSum to testFsum and move it to proper place in test_math.pyMark Dickinson2008-07-311-97/+96
|
* Rename math.sum to math.fsumMark Dickinson2008-07-301-7/+7
|
* More modifications to tests for math.sum: replace the PythonMark Dickinson2008-07-291-39/+39
| | | | | version of msum by a version using a different algorithm, and use the new float.fromhex method to specify test results exactly.
* Remove math.sum tests related to overflow, special values, and behaviourMark Dickinson2008-07-271-65/+10
| | | | | near the extremes of the floating-point range. (The behaviour of math.sum should be regarded as undefined in these cases.)
* Issue #2138: Add math.factorial().Raymond Hettinger2008-06-091-0/+15
|
* Fix typo in testSumMark Dickinson2008-05-301-1/+1
|
* Skip math.sum tests on non IEEE 754 platforms, and on IEEE 754 platformsMark Dickinson2008-05-231-0/+16
| | | | that exhibit the problem described in issue #2937.
* Better error reporting in test_math.pyMark Dickinson2008-05-231-0/+4
|
* Add tests for math.sum (Issue #2819)Mark Dickinson2008-05-231-0/+136
|
* Issue #2487. math.ldexp(x, n) raised OverflowError when n was large andMark Dickinson2008-05-091-0/+18
| | | | negative; fix to return an (appropriately signed) zero instead.
* Add test for tanh(-0.) == -0. on IEEE 754 systemsMark Dickinson2008-04-201-0/+58
|
* Yet more explicit special case handling to makeMark Dickinson2008-04-201-0/+12
| | | | | | math.pow behave on alpha Tru64. All IEEE 754 special values are now handled directly; only the finite**finite case is handled by libm.
* Report additional diagnostic information inMark Dickinson2008-04-201-1/+6
| | | | | test_math, to help track down debian-alpha buildbot failure.
* Additional tests for math.pow, and extra special-caseMark Dickinson2008-04-191-10/+124
| | | | | handling code in math.pow, in the hope of making all tests pass on the alpha Tru64 buildbot.
* I finally got the time to update and merge Mark's and my trunk-math branch. ↵Christian Heimes2008-04-181-3/+238
| | | | | | The patch is collaborated work of Mark Dickinson and me. It was mostly done a few months ago. The patch fixes a lot of loose ends and edge cases related to operations with NaN, INF, very small values and complex math. The patch also adds acosh, asinh, atanh, log1p and copysign to all platforms. Finally it fixes differences between platforms like different results or exceptions for edge cases. Have fun :)
* Move __builtins__.trunc() to math.trunc() perJeffrey Yasskin2008-02-011-0/+31
| | | | | http://mail.python.org/pipermail/python-dev/2008-January/076626.html and issue 1965.
* Continue rolling back pep-3141 changes that changed behavior from 2.5. ThisJeffrey Yasskin2008-01-051-4/+4
| | | | | | | | | | | | round included: * Revert round to its 2.6 behavior (half away from 0). * Because round, floor, and ceil always return float again, it's no longer necessary to have them delegate to __xxx___, so I've ripped that out of their implementations and the Real ABC. This also helps in implementing types that work in both 2.6 and 3.0: you return int from the __xxx__ methods, and let it get enabled by the version upgrade. * Make pow(-1, .5) raise a ValueError again.
* Make math.{floor,ceil}({int,long}) return float again for backwardsJeffrey Yasskin2008-01-041-0/+8
| | | | compatibility after r59671 made them return integral types.
* Added copysign(x, y) function to the math moduleChristian Heimes2008-01-031-0/+7
|
* Added math.isinf() and math.isnan()Christian Heimes2008-01-031-0/+16
|
* Backport PEP 3141 from the py3k branch to the trunk. This includes r50877 (justJeffrey Yasskin2008-01-031-0/+26
| | | | | | | the complex_pow part), r56649, r56652, r56715, r57296, r57302, r57359, r57361, r57372, r57738, r57739, r58017, r58039, r58040, and r59390, and new documentation. The only significant difference is that round(x) returns a float to preserve backward-compatibility. See http://bugs.python.org/issue1689.
* Make test_math error messages more meaningful for small discrepancies in resultsNick Coghlan2007-07-271-1/+5
|
* Add explicit test for a misbehaving math.floorNick Coghlan2007-07-261-0/+4
|
* Whitespace normalization.Tim Peters2006-11-031-1/+1
|
* Add tests for basic argument errors.Walter Dörwald2006-10-291-0/+27
|
* Convert test_math to unittest.Georg Brandl2006-10-281-201/+207
|
* Replace backticks with repr() or "%r"Walter Dörwald2004-02-121-4/+4
| | | | From SF patch #852334.
* Expand log() tests to include long integers.Raymond Hettinger2002-12-181-0/+2
|
* Apply SF patch 652930: Add optional base argument to math.log(x[, base]).Raymond Hettinger2002-12-141-0/+1
|
* Complete the absolute import patch for the test suite. All relativeBarry Warsaw2002-07-301-1/+1
| | | | | | | | imports of test modules now import from the test package. Other related oddities are also fixed (like DeprecationWarning filters that weren't specifying the full import part, etc.). Also did a general code cleanup to remove all "from test.test_support import *"'s. Other from...import *'s weren't changed.
* Get rid of relative imports in all unittests. Now anything thatBarry Warsaw2002-07-231-1/+1
| | | | | | | | | | | imports e.g. test_support must do so using an absolute package name such as "import test.test_support" or "from test import test_support". This also updates the README in Lib/test, and gets rid of the duplicate data dirctory in Lib/test/data (replaced by Lib/email/test/data). Now Tim and Jack can have at it. :)
* Whitespace normalization.Tim Peters2002-05-231-1/+1
|
* Adds tests for degrees() and radians() functions added to mathmodule.Raymond Hettinger2002-05-131-0/+10
| | | | Closes patch 552452 and feature request 426539.
* Rework the way we try to check for libm overflow, given that C99 no longerTim Peters2001-09-051-1/+1
| | | | | | | | | | | | | | | requires that errno ever get set, and it looks like glibc is already playing that game. New rules: + Never use HUGE_VAL. Use the new Py_HUGE_VAL instead. + Never believe errno. If overflow is the only thing you're interested in, use the new Py_OVERFLOWED(x) macro. If you're interested in any libm errors, use the new Py_SET_ERANGE_IF_OVERFLOW(x) macro, which attempts to set errno the way C89 said it worked. Unfortunately, none of these are reliable, but they work on Windows and I *expect* under glibc too.
* Reverting the "unixware7" patch: atan2(0, 1) should be 0, regardless ofTim Peters2001-04-121-5/+1
| | | | | platform. If it returns pi on the unixware7 platform, they have a bug in their libm atan2.
* Unixware 7 support by Billy G. Allie (SF patch 413011)Guido van Rossum2001-04-111-1/+5
|
* Update the code to better reflect recommended style:Fred Drake2000-12-121-1/+1
| | | | | Use != instead of <> since <> is documented as "obsolescent". Use "is" and "is not" when comparing with None or type objects.
* Make reindent.py happy (convert everything to 4-space indents!).Fred Drake2000-10-231-9/+9
|
* Test for math.* exceptional behavior only in verbose mode, so that theTim Peters2000-10-161-30/+40
| | | | | oddball platforms (where, e.g., math.exp(+huge) still fails to raise OverflowError) don't fail the std test suite when run normally.
* A Mystery: I somehow managed to delete the last two lines of my test_math.pyTim Peters2000-10-121-0/+2
| | | | changes. Here restoring them.
* Stop raising OverflowError on underflows reported by libm (errno==ERANGE andTim Peters2000-10-121-0/+29
| | | | | | | | | libm result is 0). Cautiously add a few libm exception test cases: 1. That exp(-huge) returns 0 without exception. 2. That exp(+huge) triggers OverflowError. 3. That sqrt(-1) raises ValueError specifically (apparently under glibc linked with -lieee, it was raising OverflowError due to an accident of the way mathmodule.c's CHECK() macro happened to deal with Infs and NaNs under gcc).
* remove all occurence of math.rint() from the sourcesPeter Schneider-Kamp2000-08-101-12/+0
| | | | (and yes, "Currintly" also counts <0.5 wink>)
* Trent Mick <trentm@activestate.com>:Fred Drake2000-06-011-4/+10
| | | | | Fix test of the "math" module so it does not break on platforms that do not offer rint(); just skip that portion of the test in that case.
* Added math.rint() -- round according to current IEEE754 modeGuido van Rossum2000-05-111-0/+6
|
* Subtle hack so the eps printed is not dependent on the formattingGuido van Rossum1996-08-291-2/+3
| | | | habits of the C library we happen to use...
* Added test for math moduleGuido van Rossum1996-08-081-0/+153