Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
mruby
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Libraries
mruby
Commits
2eef8f25
Commit
2eef8f25
authored
Feb 28, 2013
by
Yukihiro "Matz" Matsumoto
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #910 from mattn/pluggable_math
Pluggable Math
parents
fbe04176
6bee2fd1
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
13 additions
and
10 deletions
+13
-10
build_config.rb
build_config.rb
+3
-0
include/mrbconf.h
include/mrbconf.h
+0
-4
mgems/mruby-math/mrbgem.rake
mgems/mruby-math/mrbgem.rake
+4
-0
mgems/mruby-math/src/math.c
mgems/mruby-math/src/math.c
+6
-3
mgems/mruby-math/test/math.rb
mgems/mruby-math/test/math.rb
+0
-0
src/init.c
src/init.c
+0
-3
No files found.
build_config.rb
View file @
2eef8f25
...
...
@@ -11,6 +11,9 @@ MRuby::Build.new do |conf|
# conf.gem :github => 'masuidrive/mrbgems-example', :branch => 'master'
# conf.gem :git => 'git@github.com:masuidrive/mrbgems-example.git', :branch => 'master', :options => '-v'
# Use standard Math module
conf
.
gem
'mgems/mruby-math'
# Use standard Time class
conf
.
gem
'mgems/mruby-time'
...
...
include/mrbconf.h
View file @
2eef8f25
...
...
@@ -45,7 +45,6 @@
/* -DDISABLE_XXXX to drop following features */
//#define DISABLE_SPRINTF /* Kernel.sprintf method */
//#define DISABLE_MATH /* Math functions */
//#define DISABLE_STRUCT /* Struct class */
//#define DISABLE_STDIO /* use of stdio */
...
...
@@ -85,9 +84,6 @@ typedef short mrb_sym;
#ifndef DISABLE_SPRINTF
#define ENABLE_SPRINTF
#endif
#ifndef DISABLE_MATH
#define ENABLE_MATH
#endif
#ifndef DISABLE_STRUCT
#define ENABLE_STRUCT
#endif
...
...
mgems/mruby-math/mrbgem.rake
0 → 100644
View file @
2eef8f25
MRuby
::
Gem
::
Specification
.
new
(
'mruby-math'
)
do
|
spec
|
spec
.
license
=
'MIT'
spec
.
authors
=
'mruby developers'
end
src/math.c
→
mgems/mruby-math/
src/math.c
View file @
2eef8f25
...
...
@@ -7,7 +7,6 @@
#include "mruby.h"
#include "mruby/array.h"
#ifdef ENABLE_MATH
#include <math.h>
#define domain_error(msg) \
...
...
@@ -630,7 +629,7 @@ math_erfc(mrb_state *mrb, mrb_value obj)
/* ------------------------------------------------------------------------*/
void
mrb_
init_math
(
mrb_state
*
mrb
)
mrb_
mruby_math_gem_init
(
mrb_state
*
mrb
)
{
struct
RClass
*
mrb_math
;
mrb_math
=
mrb_define_module
(
mrb
,
"Math"
);
...
...
@@ -685,4 +684,8 @@ mrb_init_math(mrb_state *mrb)
mrb_define_module_function
(
mrb
,
mrb_math
,
"erf"
,
math_erf
,
ARGS_REQ
(
1
));
mrb_define_module_function
(
mrb
,
mrb_math
,
"erfc"
,
math_erfc
,
ARGS_REQ
(
1
));
}
#endif
/* ENABLE_MATH */
void
mrb_mruby_math_gem_final
(
mrb_state
*
mrb
)
{
}
test/
t/math.rb
→
mgems/mruby-math/tes
t/math.rb
View file @
2eef8f25
File moved
src/init.c
View file @
2eef8f25
...
...
@@ -56,9 +56,6 @@ mrb_init_core(mrb_state *mrb)
mrb_init_regexp
(
mrb
);
DONE
;
#ifdef ENABLE_STDIO
mrb_init_print
(
mrb
);
DONE
;
#endif
#ifdef ENABLE_MATH
mrb_init_math
(
mrb
);
DONE
;
#endif
mrb_init_mrblib
(
mrb
);
DONE
;
#ifndef DISABLE_GEMS
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment