diff options
author | Mark Dickinson <dickinsm@gmail.com> | 2009-12-16 20:23:42 (GMT) |
---|---|---|
committer | Mark Dickinson <dickinsm@gmail.com> | 2009-12-16 20:23:42 (GMT) |
commit | 664b511c0acdfdecdec92d2255ffd94c4e6d5f7a (patch) | |
tree | 075cdf8651d66f24e42c1b87e57e7423e3e7a9d3 /Modules/mathmodule.c | |
parent | ef1992b9fbcfb1dae7e946bfc42403fcaae9f044 (diff) | |
download | cpython-664b511c0acdfdecdec92d2255ffd94c4e6d5f7a.zip cpython-664b511c0acdfdecdec92d2255ffd94c4e6d5f7a.tar.gz cpython-664b511c0acdfdecdec92d2255ffd94c4e6d5f7a.tar.bz2 |
Merged revisions 76861 via svnmerge from
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.
........
Diffstat (limited to 'Modules/mathmodule.c')
-rw-r--r-- | Modules/mathmodule.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/Modules/mathmodule.c b/Modules/mathmodule.c index ece68a7..ef84298 100644 --- a/Modules/mathmodule.c +++ b/Modules/mathmodule.c @@ -53,6 +53,7 @@ raised for division by zero and mod by zero. */ #include "Python.h" +#include "_math.h" #include "longintrepr.h" /* just for SHIFT */ #ifdef _OSF_SOURCE @@ -722,6 +723,10 @@ FUNC1(cosh, cosh, 1, "cosh(x)\n\nReturn the hyperbolic cosine of x.") FUNC1(exp, exp, 1, "exp(x)\n\nReturn e raised to the power of x.") +FUNC1(expm1, m_expm1, 1, + "expm1(x)\n\nReturn exp(x)-1.\n" + "This function avoids the loss of precision involved in the direct " + "evaluation of exp(x)-1 for small x.") FUNC1(fabs, fabs, 0, "fabs(x)\n\nReturn the absolute value of the float x.") @@ -1493,6 +1498,7 @@ static PyMethodDef math_methods[] = { {"cosh", math_cosh, METH_O, math_cosh_doc}, {"degrees", math_degrees, METH_O, math_degrees_doc}, {"exp", math_exp, METH_O, math_exp_doc}, + {"expm1", math_expm1, METH_O, math_expm1_doc}, {"fabs", math_fabs, METH_O, math_fabs_doc}, {"factorial", math_factorial, METH_O, math_factorial_doc}, {"floor", math_floor, METH_O, math_floor_doc}, |