summaryrefslogtreecommitdiffstats
path: root/Modules/mathmodule.c
diff options
context:
space:
mode:
authorGuido van Rossum <guido@dropbox.com>2016-08-15 16:12:52 (GMT)
committerGuido van Rossum <guido@dropbox.com>2016-08-15 16:12:52 (GMT)
commit0a891d70ded5fa8b1e6491529a3b531f521b5ae1 (patch)
treee26a1c826888bbd3c40b7775406062ab1b32cca5 /Modules/mathmodule.c
parent6349612a8e5d5fcb3405e59242b6a2df3127585a (diff)
downloadcpython-0a891d70ded5fa8b1e6491529a3b531f521b5ae1.zip
cpython-0a891d70ded5fa8b1e6491529a3b531f521b5ae1.tar.gz
cpython-0a891d70ded5fa8b1e6491529a3b531f521b5ae1.tar.bz2
Issue #12345: Add mathemathcal constant tau to math and cmath.
Patch by Lisa Roach. See also PEP 628.
Diffstat (limited to 'Modules/mathmodule.c')
-rw-r--r--Modules/mathmodule.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/Modules/mathmodule.c b/Modules/mathmodule.c
index cf04901..43aa229 100644
--- a/Modules/mathmodule.c
+++ b/Modules/mathmodule.c
@@ -2144,6 +2144,7 @@ PyInit_math(void)
PyModule_AddObject(m, "pi", PyFloat_FromDouble(Py_MATH_PI));
PyModule_AddObject(m, "e", PyFloat_FromDouble(Py_MATH_E));
+ PyModule_AddObject(m, "tau", PyFloat_FromDouble(Py_MATH_TAU)); /* 2pi */
PyModule_AddObject(m, "inf", PyFloat_FromDouble(m_inf()));
#if !defined(PY_NO_SHORT_FLOAT_REPR) || defined(Py_NAN)
PyModule_AddObject(m, "nan", PyFloat_FromDouble(m_nan()));