summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
authorGideon <41593269+Turreted@users.noreply.github.com>2021-11-29 18:55:43 (GMT)
committerGitHub <noreply@github.com>2021-11-29 18:55:43 (GMT)
commit6266e4af873a27c9d352115f2f7a1ad0885fc031 (patch)
treef7cccb86aa38df82d29cf17767c8c7f571e5cf00 /Modules
parentc1f93f0d378958dfae4f24aad0c0088e3e04e403 (diff)
downloadcpython-6266e4af873a27c9d352115f2f7a1ad0885fc031.zip
cpython-6266e4af873a27c9d352115f2f7a1ad0885fc031.tar.gz
cpython-6266e4af873a27c9d352115f2f7a1ad0885fc031.tar.bz2
bpo-45917: Add math.exp2() method - return 2 raised to the power of x (GH-29829)
Co-authored-by: Mark Dickinson <dickinsm@gmail.com>
Diffstat (limited to 'Modules')
-rw-r--r--Modules/mathmodule.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/Modules/mathmodule.c b/Modules/mathmodule.c
index 67669f1..64ce4e6 100644
--- a/Modules/mathmodule.c
+++ b/Modules/mathmodule.c
@@ -1248,6 +1248,9 @@ FUNC1A(erfc, m_erfc,
FUNC1(exp, exp, 1,
"exp($module, x, /)\n--\n\n"
"Return e raised to the power of x.")
+FUNC1(exp2, exp2, 1,
+ "exp2($module, x, /)\n--\n\n"
+ "Return 2 raised to the power of x.")
FUNC1(expm1, expm1, 1,
"expm1($module, x, /)\n--\n\n"
"Return exp(x)-1.\n\n"
@@ -3564,6 +3567,7 @@ static PyMethodDef math_methods[] = {
{"erf", math_erf, METH_O, math_erf_doc},
{"erfc", math_erfc, METH_O, math_erfc_doc},
{"exp", math_exp, METH_O, math_exp_doc},
+ {"exp2", math_exp2, METH_O, math_exp2_doc},
{"expm1", math_expm1, METH_O, math_expm1_doc},
{"fabs", math_fabs, METH_O, math_fabs_doc},
MATH_FACTORIAL_METHODDEF