summaryrefslogtreecommitdiffstats
path: root/Modules/mathmodule.c
Commit message (Collapse)AuthorAgeFilesLines
* Make use of PyLong_AsLongAndOverflow in math_ldexp.Mark Dickinson2010-01-031-20/+7
|
* Refactor some longobject internals: PyLong_AsDouble and _PyLong_AsScaledDoubleMark Dickinson2010-01-021-12/+15
| | | | | | | | (the latter renamed to _PyLong_Frexp) now use the same core code. The exponent produced by _PyLong_Frexp now has type Py_ssize_t instead of the previously used int, and no longer needs scaling by PyLong_SHIFT. This frees the math module from having to know anything about the PyLong implementation. This closes issue #5576.
* Issue #7518: Move substitute definitions of C99 math functions fromMark Dickinson2009-12-211-4/+4
| | | | pymath.c to Modules/_math.c.
* math.factorial depends on PyLong_AsLong correctly converting floats; rewriteMark Dickinson2009-12-201-2/+9
| | | | it to do the conversion explicitly instead. See issue #7550.
* Issue #3366: Add error function and complementary error function toMark Dickinson2009-12-191-0/+142
| | | | math module.
* Issue #3366: Add expm1 function to math module. Thanks Eric Smith forMark Dickinson2009-12-161-0/+6
| | | | testing on Windows.
* Issue #3366: Add lgamma function to math module.Mark Dickinson2009-12-111-0/+57
|
* Use a single style for all the docstrings in the math module.Georg Brandl2009-10-291-15/+19
|
* Use the correct function name in docstring.Georg Brandl2009-10-291-1/+1
|
* Issue #3366: Add gamma function to math module.Mark Dickinson2009-09-281-35/+325
| | | | (lgamma, erf and erfc to follow).
* remove redundant sentenceBenjamin Peterson2008-12-201-1/+1
|
* beef up docstringBenjamin Peterson2008-12-201-1/+4
|
* Issues #3167, #3682: tests for math.log and math.log10 were failing onMark Dickinson2008-12-111-3/+55
| | | | | | 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
|