summaryrefslogtreecommitdiffstats
path: root/Modules/mathmodule.c
Commit message (Collapse)AuthorAgeFilesLines
* Merged revisions 82221 via svnmerge fromMark Dickinson2010-06-251-11/+11
| | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/trunk ........ r82221 | mark.dickinson | 2010-06-25 21:19:48 +0100 (Fri, 25 Jun 2010) | 1 line Fix indentation of Python code example in C comment. ........
* Recorded merge of revisions 81029 via svnmerge fromAntoine Pitrou2010-05-091-657/+657
| | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/trunk ........ r81029 | antoine.pitrou | 2010-05-09 16:46:46 +0200 (dim., 09 mai 2010) | 3 lines Untabify C files. Will watch buildbots. ........
* Merged revisions 75952-75953,75955,76105,76143,76223,76259,76326,76376-76377 ↵Georg Brandl2010-03-211-16/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | via svnmerge from svn+ssh://pythondev@svn.python.org/python/trunk ........ r75952 | georg.brandl | 2009-10-29 21:38:32 +0100 (Do, 29 Okt 2009) | 1 line Use the correct function name in docstring. ........ r75953 | georg.brandl | 2009-10-29 21:39:50 +0100 (Do, 29 Okt 2009) | 1 line Remove mention of the old -X command line switch. ........ r75955 | georg.brandl | 2009-10-29 21:54:03 +0100 (Do, 29 Okt 2009) | 1 line Use a single style for all the docstrings in the math module. ........ r76105 | georg.brandl | 2009-11-04 08:38:12 +0100 (Mi, 04 Nov 2009) | 1 line #7259: show correct equivalent for operator.i* operations in docstring; fix minor issues in operator docs. ........ r76143 | georg.brandl | 2009-11-07 09:26:07 +0100 (Sa, 07 Nov 2009) | 1 line #7271: fix typo. ........ r76223 | georg.brandl | 2009-11-12 09:29:46 +0100 (Do, 12 Nov 2009) | 1 line Give the profile module a module directive. ........ r76259 | georg.brandl | 2009-11-14 12:50:51 +0100 (Sa, 14 Nov 2009) | 1 line Fix terminology. ........ r76326 | georg.brandl | 2009-11-16 17:44:05 +0100 (Mo, 16 Nov 2009) | 1 line #7302: fix link. ........ r76376 | georg.brandl | 2009-11-18 20:39:14 +0100 (Mi, 18 Nov 2009) | 1 line upcase Python ........ r76377 | georg.brandl | 2009-11-18 21:05:15 +0100 (Mi, 18 Nov 2009) | 1 line Fix markup. ........
* Merged revisions ↵Benjamin Peterson2008-12-211-2/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 67654,67676-67677,67681,67692,67725,67746,67748,67761,67784-67785,67787-67788,67802,67832,67848-67849,67859,67862-67864,67880,67882,67885,67889-67892,67895 via svnmerge from svn+ssh://pythondev@svn.python.org/python/trunk ................ r67654 | georg.brandl | 2008-12-07 16:42:09 -0600 (Sun, 07 Dec 2008) | 2 lines #4457: rewrite __import__() documentation. ................ r67676 | benjamin.peterson | 2008-12-08 20:03:03 -0600 (Mon, 08 Dec 2008) | 1 line specify how things are copied ................ r67677 | benjamin.peterson | 2008-12-08 20:05:11 -0600 (Mon, 08 Dec 2008) | 1 line revert unrelated change to installer script ................ r67681 | jeremy.hylton | 2008-12-09 15:03:10 -0600 (Tue, 09 Dec 2008) | 2 lines Add simple unittests for Request ................ r67692 | amaury.forgeotdarc | 2008-12-10 18:03:42 -0600 (Wed, 10 Dec 2008) | 2 lines #1030250: correctly pass the dry_run option to the mkpath() function. ................ r67725 | benjamin.peterson | 2008-12-12 22:02:20 -0600 (Fri, 12 Dec 2008) | 1 line fix incorrect example ................ r67746 | antoine.pitrou | 2008-12-13 17:12:30 -0600 (Sat, 13 Dec 2008) | 3 lines Issue #4163: Use unicode-friendly word splitting in the textwrap functions when given an unicode string. ................ r67748 | benjamin.peterson | 2008-12-13 19:46:11 -0600 (Sat, 13 Dec 2008) | 1 line remove has_key usage ................ r67761 | benjamin.peterson | 2008-12-14 11:26:04 -0600 (Sun, 14 Dec 2008) | 1 line fix missing bracket ................ r67784 | georg.brandl | 2008-12-15 02:33:58 -0600 (Mon, 15 Dec 2008) | 2 lines #4446: document "platforms" argument for setup(). ................ r67785 | georg.brandl | 2008-12-15 02:36:11 -0600 (Mon, 15 Dec 2008) | 2 lines #4611: fix typo. ................ r67787 | georg.brandl | 2008-12-15 02:58:59 -0600 (Mon, 15 Dec 2008) | 2 lines #4578: fix has_key() usage in compiler package. ................ r67788 | georg.brandl | 2008-12-15 03:07:39 -0600 (Mon, 15 Dec 2008) | 2 lines #4568: remove limitation in varargs callback example. ................ r67802 | amaury.forgeotdarc | 2008-12-15 16:29:14 -0600 (Mon, 15 Dec 2008) | 4 lines #3632: the "pyo" macro from gdbinit can now run when the GIL is released. Patch by haypo. ................ r67832 | antoine.pitrou | 2008-12-17 16:46:54 -0600 (Wed, 17 Dec 2008) | 4 lines Issue #2467: gc.DEBUG_STATS reports invalid elapsed times. Patch by Neil Schemenauer, very slightly modified. ................ r67848 | benjamin.peterson | 2008-12-18 20:28:56 -0600 (Thu, 18 Dec 2008) | 1 line fix typo ................ r67849 | benjamin.peterson | 2008-12-18 20:31:35 -0600 (Thu, 18 Dec 2008) | 1 line _call_method -> _callmethod and _get_value to _getvalue ................ r67859 | amaury.forgeotdarc | 2008-12-19 16:56:48 -0600 (Fri, 19 Dec 2008) | 4 lines #4700: crtlicense.txt is displayed by the license() command and should be kept ascii-only. Will port to 3.0 ................ r67862 | benjamin.peterson | 2008-12-19 20:48:02 -0600 (Fri, 19 Dec 2008) | 1 line copy sentence from docstring ................ r67863 | benjamin.peterson | 2008-12-19 20:51:26 -0600 (Fri, 19 Dec 2008) | 1 line add headings ................ r67864 | benjamin.peterson | 2008-12-19 20:57:19 -0600 (Fri, 19 Dec 2008) | 1 line beef up docstring ................ r67880 | benjamin.peterson | 2008-12-20 16:49:24 -0600 (Sat, 20 Dec 2008) | 1 line remove redundant sentence ................ r67882 | benjamin.peterson | 2008-12-20 16:59:49 -0600 (Sat, 20 Dec 2008) | 1 line add some recent releases to the list ................ r67885 | benjamin.peterson | 2008-12-20 17:48:54 -0600 (Sat, 20 Dec 2008) | 1 line silence annoying DeprecationWarning ................ r67889 | benjamin.peterson | 2008-12-20 19:04:32 -0600 (Sat, 20 Dec 2008) | 1 line sphinx.web is long gone ................ r67890 | benjamin.peterson | 2008-12-20 19:12:26 -0600 (Sat, 20 Dec 2008) | 1 line update readme ................ r67891 | benjamin.peterson | 2008-12-20 19:14:47 -0600 (Sat, 20 Dec 2008) | 1 line there are way too many places which need to have the current version added ................ r67892 | benjamin.peterson | 2008-12-20 19:29:32 -0600 (Sat, 20 Dec 2008) | 9 lines Merged revisions 67809 via svnmerge from svn+ssh://pythondev@svn.python.org/sandbox/trunk/2to3/lib2to3 ........ r67809 | benjamin.peterson | 2008-12-15 21:54:45 -0600 (Mon, 15 Dec 2008) | 1 line fix logic error ........ ................ r67895 | neal.norwitz | 2008-12-21 08:28:32 -0600 (Sun, 21 Dec 2008) | 2 lines Add Tarek for work on distutils. ................
* Merged revisions 67707 via svnmerge fromMark Dickinson2008-12-111-3/+55
| | | | | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/trunk ........ r67707 | mark.dickinson | 2008-12-11 19:28:08 +0000 (Thu, 11 Dec 2008) | 5 lines Issues #3167, #3682: tests for math.log and math.log10 were failing on Solaris and OpenBSD. Fix this by handling special values and domain errors directly in mathmodule.c, passing only positive nonspecial floats to the system log/log10. ........
* Replace math.sum with math.fsum in a couple of commentsMark Dickinson2008-07-301-2/+2
| | | | that were missed by r65308
* Rename math.sum to math.fsumMark Dickinson2008-07-301-16/+16
|
* Fix special-value handling for math.sum.Mark Dickinson2008-07-301-38/+54
| | | | | | Also minor cleanups to the code: fix tabbing, remove trailing whitespace, and reformat to fit into 80 columns.
* Fix another typo in math_sum commentMark Dickinson2008-06-201-1/+1
|
* Fix comment typosAndrew M. Kuchling2008-06-201-2/+2
|
* Fix double decref.Raymond Hettinger2008-06-181-1/+0
|
* Issue 3118: make test_math pass on Ubuntu/ia64. exp(-745.0) was raisingMark Dickinson2008-06-171-3/+8
| | | | | OverflowError incorrectly on this platform, presumably as a result of the libm setting errno = ERANGE for this call.
* Unhappy buildbots. Revert 64052. Long doubles have unexpected effects on ↵Raymond Hettinger2008-06-091-20/+24
| | | | some builds.
* Address double-rounding scenarios by setting all variables to long doubles.Raymond Hettinger2008-06-091-24/+19
|
* Issue #2138: Add math.factorial().Raymond Hettinger2008-06-091-0/+50
|
* * Mark intermedidate computes values (hi, lo, yr) as volatile.Raymond Hettinger2008-05-301-19/+31
| | | | | | | * 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.
* Fix two typos.Raymond Hettinger2008-05-291-2/+2
|
* Tweak the comments and formatting.Raymond Hettinger2008-05-231-76/+47
|
* Issue #2819: Add math.sum, a function that sums a sequence of floatsMark Dickinson2008-05-231-0/+223
| | | | | efficiently but with no intermediate loss of precision. Based on Raymond Hettinger's ASPN recipe. Thanks Jean Brouwers for the patch.
* Issue #2487. math.ldexp(x, n) raised OverflowError when n was large andMark Dickinson2008-05-091-12/+54
| | | | negative; fix to return an (appropriately signed) zero instead.
* Silence 'r may be used uninitialized' compiler warning.Mark Dickinson2008-04-211-0/+1
|
* math.atan2 is misbehaving on Windows; this patchMark Dickinson2008-04-201-1/+37
| | | | | should fix the problem in the same way that the cmath.phase problems were fixed.
* Yet more explicit special case handling to makeMark Dickinson2008-04-201-47/+55
| | | | | | math.pow behave on alpha Tru64. All IEEE 754 special values are now handled directly; only the finite**finite case is handled by libm.
* FreeBSD doesn't follow C99 for modf(inf); so add explicitMark Dickinson2008-04-201-0/+9
| | | | special-value handling to math.modf code.
* Additional special-case handling for math.pow.Mark Dickinson2008-04-191-6/+13
| | | | Windows/VS2008 doesn't like (-1)**(+-inf).
* Additional tests for math.pow, and extra special-caseMark Dickinson2008-04-191-0/+11
| | | | | 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-96/+344
| | | | | | 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 :)
* Neaten-up a bit.Raymond Hettinger2008-02-021-5/+1
|
* Move __builtins__.trunc() to math.trunc() perJeffrey Yasskin2008-02-011-0/+16
| | | | | http://mail.python.org/pipermail/python-dev/2008-January/076626.html and issue 1965.
* setup.py doesn't pick up changes to a header fileChristian Heimes2008-01-251-4/+4
|
* Add prototypes to get the mathmodule.c to compile on OSF1 5.1 (Tru64)Neal Norwitz2008-01-251-0/+5
| | | | | and eliminate a compiler warning in floatobject.c. There might be a better way to go about this, but it should be good enough for now.
* Continue rolling back pep-3141 changes that changed behavior from 2.5. ThisJeffrey Yasskin2008-01-051-44/+6
| | | | | | | | | | | | 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.
* Fixed math.copysign() on WindowsChristian Heimes2008-01-041-6/+8
|
* Added copysign(x, y) function to the math moduleChristian Heimes2008-01-031-0/+11
|
* Added math.isinf() and math.isnan()Christian Heimes2008-01-031-6/+34
|
* Backport PEP 3141 from the py3k branch to the trunk. This includes r50877 (justJeffrey Yasskin2008-01-031-6/+44
| | | | | | | 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.
* Speed up function calls into the math module by using METH_O.Neal Norwitz2006-11-191-63/+55
| | | | | There should be no functional changes. However, the error msgs are slightly different. Also verified that the module dict is not NULL on init.
* Whoops.Georg Brandl2006-05-291-2/+6
|
* Convert more modules to METH_VARARGS.Georg Brandl2006-05-291-6/+2
|
* Check return result from Py_InitModule*(). This API can fail.Neal Norwitz2006-01-191-0/+2
| | | | Probably should be backported.
* Make that a C, not a C++, comment.Michael W. Hudson2005-04-061-1/+1
|
* Add a comment explaining the import of longintrepr.h.Michael W. Hudson2005-04-061-1/+1
|
* Patch #871657: Set EDOM for `nan' return values on FreeBSD and OpenBSD.Hye-Shik Chang2004-03-221-5/+5
| | | | This fixes a problem that math.sqrt(-1) doesn't raise math.error.
* Getting rid of support for the ancient Apple MPW compiler.Jack Jansen2003-11-191-13/+0
|
* Simplify and speedup uses of Py_BuildValue():Raymond Hettinger2003-10-121-6/+2
| | | | | | * Py_BuildValue("(OOO)",a,b,c) --> PyTuple_Pack(3,a,b,c) * Py_BuildValue("()",a) --> PyTuple_New(0) * Py_BuildValue("O", a) --> Py_INCREF(a)
* SF patch #659536: Use PyArg_UnpackTuple where possible.Raymond Hettinger2002-12-291-2/+2
| | | | | | | Obtain cleaner coding and a system wide performance boost by using the fast, pre-parsed PyArg_Unpack function instead of PyArg_ParseTuple function which is driven by a format string.
* Apply SF patch 652930: Add optional base argument to math.log(x[, base]).Raymond Hettinger2002-12-141-15/+47
|
* Excise DL_EXPORT/DL_IMPORT from Modules/*. Required adding a prototypeMark Hammond2002-08-021-1/+1
| | | | | | for Py_Main(). Thanks to Kalle Svensson and Skip Montanaro for the patches.
* Patch #568124: Add doc string macros.Martin v. Löwis2002-06-131-18/+18
|
* Added degrees() and radians() to mathmodule. Closes patch 552452 andRaymond Hettinger2002-05-131-0/+27
| | | | feature request 426539.