We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
0 parents commit fbcde0fCopy full SHA for fbcde0f
2 files changed
README.md
@@ -0,0 +1,4 @@
1
+In this repository will live user contributed wrappers
2
+for ChaiScript.
3
+
4
include/chaiscript/extras/math.hpp
@@ -0,0 +1,25 @@
+#include <cmath>
+namespace chaiscript {
+ namespace extras {
5
+ namespace math {
6
+ template<typename Ret, typename Param>
7
+ ModulePtr floor(ModulePtr m = std::make_shared<Module>())
8
+ {
9
+ // using the overloads provided by C++11
10
+ // http://www.cplusplus.com/reference/cmath/floor/
11
+ m->add(chaiscript::fun(static_cast<Ret (Param)>(&std::floor)), "floor");
12
+ return m;
13
+ }
14
15
+ ModulePtr bootstrap(const std::string &type, ModulePtr m = std::make_shared<Module>())
16
17
+ floor<double, double>(m);
18
+ floor<long double, long double>(m);
19
+ floor<float, float>(m);
20
21
22
23
24
25
+}
0 commit comments