diff options
Diffstat (limited to 'core/math')
-rw-r--r-- | core/math/expression.cpp | 7 | ||||
-rw-r--r-- | core/math/expression.h | 1 |
2 files changed, 8 insertions, 0 deletions
diff --git a/core/math/expression.cpp b/core/math/expression.cpp index 133dcc7ab9..079c9b524f 100644 --- a/core/math/expression.cpp +++ b/core/math/expression.cpp @@ -64,6 +64,7 @@ const char *Expression::func_name[Expression::FUNC_MAX] = { "is_inf", "ease", "decimals", + "step_decimals", "stepify", "lerp", "inverse_lerp", @@ -149,6 +150,7 @@ int Expression::get_func_argument_count(BuiltinFunc p_func) { case MATH_ISNAN: case MATH_ISINF: case MATH_DECIMALS: + case MATH_STEP_DECIMALS: case MATH_SEED: case MATH_RANDSEED: case MATH_DEG2RAD: @@ -365,6 +367,11 @@ void Expression::exec_func(BuiltinFunc p_func, const Variant **p_inputs, Variant VALIDATE_ARG_NUM(0); *r_return = Math::step_decimals((double)*p_inputs[0]); } break; + case MATH_STEP_DECIMALS: { + + VALIDATE_ARG_NUM(0); + *r_return = Math::step_decimals((double)*p_inputs[0]); + } break; case MATH_STEPIFY: { VALIDATE_ARG_NUM(0); diff --git a/core/math/expression.h b/core/math/expression.h index f9075cb689..f20619f0b6 100644 --- a/core/math/expression.h +++ b/core/math/expression.h @@ -62,6 +62,7 @@ public: MATH_ISINF, MATH_EASE, MATH_DECIMALS, + MATH_STEP_DECIMALS, MATH_STEPIFY, MATH_LERP, MATH_INVERSE_LERP, |