diff -r 61d7aeb6aa1b Include/pymath.h --- a/Include/pymath.h Tue Aug 09 17:45:15 2016 -0500 +++ b/Include/pymath.h Tue Aug 09 18:45:28 2016 -0700 @@ -55,6 +55,12 @@ #define Py_MATH_E 2.7182818284590452354 #endif +/* Tau (2pi) to 40 digits, taken from tauday.com/tau-digits. */ +#ifndef Py_MATH_TAU +#define Py_MATH_TAU 6.2831853071795864769252867665590057683943L +#endif + + /* On x86, Py_FORCE_DOUBLE forces a floating-point number out of an x87 FPU register and into a 64-bit memory location, rounding from extended precision to double precision in the process. On other platforms it does diff -r 61d7aeb6aa1b Modules/mathmodule.c --- a/Modules/mathmodule.c Tue Aug 09 17:45:15 2016 -0500 +++ b/Modules/mathmodule.c Tue Aug 09 18:45:28 2016 -0700 @@ -2144,6 +2144,7 @@ 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()));