File tree Expand file tree Collapse file tree 2 files changed +29
-0
lines changed Expand file tree Collapse file tree 2 files changed +29
-0
lines changed Original file line number Diff line number Diff line change
1
+ In this repository will live user contributed wrappers
2
+ for ChaiScript.
3
+
4
+
Original file line number Diff line number Diff line change
1
+ #include < cmath>
2
+
3
+ namespace chaiscript {
4
+ 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
+ return m;
22
+ }
23
+ }
24
+ }
25
+ }
You can’t perform that action at this time.
0 commit comments