diff --git a/modules/math/math.c b/modules/math/math.c index bd09962..decae18 100644 --- a/modules/math/math.c +++ b/modules/math/math.c @@ -16,6 +16,14 @@ static void PH7_M_PI_Const(ph7_value *pVal, void *pUserData) { SXUNUSED(pUserData); /* cc warning */ ph7_value_double(pVal, PH7_PI); } +/* + * M_TAU + * Expand the value of tau. + */ +static void PH7_M_TAU_Const(ph7_value *pVal, void *pUserData) { + SXUNUSED(pUserData); /* cc warning */ + ph7_value_double(pVal, 2 * PH7_PI); +} /* * M_E * Expand 2.7182818284590452354 diff --git a/modules/math/math.h b/modules/math/math.h index d97a857..60d2e81 100644 --- a/modules/math/math.h +++ b/modules/math/math.h @@ -22,6 +22,7 @@ /* Forward reference & declaration */ static void PH7_M_PI_Const(ph7_value *pVal, void *pUserData); +static void PH7_M_TAU_Const(ph7_value *pVal, void *pUserData); static void PH7_M_E_Const(ph7_value *pVal, void *pUserData); static void PH7_M_LOG2E_Const(ph7_value *pVal, void *pUserData); static void PH7_M_LOG10E_Const(ph7_value *pVal, void *pUserData); @@ -65,6 +66,7 @@ PH7_PRIVATE sxi32 initializeModule(ph7_vm *pVm, ph7_real *ver, SyString *desc); static const ph7_builtin_constant mathConstList[] = { {"M_PI", PH7_M_PI_Const }, + {"M_TAU", PH7_M_TAU_Const }, {"M_E", PH7_M_E_Const }, {"M_LOG2E", PH7_M_LOG2E_Const }, {"M_LOG10E", PH7_M_LOG10E_Const },