diff --git a/src/language/CMathModule.cpp b/src/language/CMathModule.cpp index 46d2f1f94faf2ef674f626501925603be50f20a7..a40372b7baee0b33b3833eabb7b990c7e27e5abc 100644 --- a/src/language/CMathModule.cpp +++ b/src/language/CMathModule.cpp @@ -49,4 +49,19 @@ CMathModule::CMathModule() this->_addFunction("pow", std::make_shared<CFunctionEmbedder<double, double, double>>(std::function<double(double, double)>{ [](double x, double y) -> double { return std::pow(x, y); }})); + + this->_addFunction("trunc", std::make_shared<CFunctionEmbedder<double, double>>( + std::function<double(double)>{[](double x) -> double { return std::trunc(x); }})); + + this->_addFunction("round", std::make_shared<CFunctionEmbedder<double, double>>( + std::function<double(double)>{[](double x) -> double { return std::round(x); }})); + + this->_addFunction("lround", std::make_shared<CFunctionEmbedder<int64_t, double>>( + std::function<int64_t(double)>{[](double x) -> int64_t { return std::lround(x); }})); + + this->_addFunction("rint", std::make_shared<CFunctionEmbedder<double, double>>( + std::function<double(double)>{[](double x) -> double { return std::rint(x); }})); + + this->_addFunction("lrint", std::make_shared<CFunctionEmbedder<int64_t, double>>( + std::function<int64_t(double)>{[](double x) -> int64_t { return std::lrint(x); }})); }