Implement TAU.
The build was successful. Details

This commit is contained in:
Rafal Kupiec 2019-06-29 14:21:29 +02:00
parent 616b2eeae3
commit 204060fa9d
Signed by: belliash
GPG Key ID: 4E829243E0CFE6B4
2 changed files with 10 additions and 0 deletions

View File

@ -16,6 +16,14 @@ static void PH7_M_PI_Const(ph7_value *pVal, void *pUserData) {
SXUNUSED(pUserData); /* cc warning */ SXUNUSED(pUserData); /* cc warning */
ph7_value_double(pVal, PH7_PI); 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 * M_E
* Expand 2.7182818284590452354 * Expand 2.7182818284590452354

View File

@ -22,6 +22,7 @@
/* Forward reference & declaration */ /* Forward reference & declaration */
static void PH7_M_PI_Const(ph7_value *pVal, void *pUserData); 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_E_Const(ph7_value *pVal, void *pUserData);
static void PH7_M_LOG2E_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); 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[] = { static const ph7_builtin_constant mathConstList[] = {
{"M_PI", PH7_M_PI_Const }, {"M_PI", PH7_M_PI_Const },
{"M_TAU", PH7_M_TAU_Const },
{"M_E", PH7_M_E_Const }, {"M_E", PH7_M_E_Const },
{"M_LOG2E", PH7_M_LOG2E_Const }, {"M_LOG2E", PH7_M_LOG2E_Const },
{"M_LOG10E", PH7_M_LOG10E_Const }, {"M_LOG10E", PH7_M_LOG10E_Const },