diff options
| author | Yukihiro "Matz" Matsumoto <[email protected]> | 2019-05-17 11:27:21 +0900 |
|---|---|---|
| committer | Yukihiro "Matz" Matsumoto <[email protected]> | 2019-05-17 11:27:21 +0900 |
| commit | 0c91da257bf64769d85a709852cfa2da313a4185 (patch) | |
| tree | b6d79a3d89866cd4416144c824eef6f5d457670c | |
| parent | 223defd62ae511786a2b50c68ed97b73bfc05d59 (diff) | |
| download | mruby-0c91da257bf64769d85a709852cfa2da313a4185.tar.gz mruby-0c91da257bf64769d85a709852cfa2da313a4185.zip | |
Remove unused `mrb_num_div()` function.
| -rw-r--r-- | include/mruby/numeric.h | 1 | ||||
| -rw-r--r-- | src/numeric.c | 35 |
2 files changed, 11 insertions, 25 deletions
diff --git a/include/mruby/numeric.h b/include/mruby/numeric.h index 9a04631d6..2fae3142d 100644 --- a/include/mruby/numeric.h +++ b/include/mruby/numeric.h @@ -39,7 +39,6 @@ MRB_API mrb_float mrb_to_flo(mrb_state *mrb, mrb_value x); mrb_value mrb_fixnum_plus(mrb_state *mrb, mrb_value x, mrb_value y); mrb_value mrb_fixnum_minus(mrb_state *mrb, mrb_value x, mrb_value y); mrb_value mrb_fixnum_mul(mrb_state *mrb, mrb_value x, mrb_value y); -mrb_value mrb_num_div(mrb_state *mrb, mrb_value x, mrb_value y); #ifndef __has_builtin #define __has_builtin(x) 0 diff --git a/src/numeric.c b/src/numeric.c index 8c17635a2..8e5fefa04 100644 --- a/src/numeric.c +++ b/src/numeric.c @@ -112,30 +112,6 @@ num_pow(mrb_state *mrb, mrb_value x) #endif } -/* 15.2.8.3.4 */ -/* 15.2.9.3.4 */ -/* - * call-seq: - * num / other -> num - * - * Performs division: the class of the resulting object depends on - * the class of <code>num</code> and on the magnitude of the - * result. - */ - -mrb_value -mrb_num_div(mrb_state *mrb, mrb_value x, mrb_value y) -{ -#ifdef MRB_WITHOUT_FLOAT - if (!mrb_fixnum_p(y)) { - mrb_raise(mrb, E_TYPE_ERROR, "non fixnum value"); - } - return mrb_fixnum_value(mrb_fixnum(x) / mrb_fixnum(y)); -#else - return mrb_float_value(mrb, mrb_to_flo(mrb, x) / mrb_to_flo(mrb, y)); -#endif -} - static mrb_value num_idiv(mrb_state *mrb, mrb_value x) { @@ -155,6 +131,17 @@ num_idiv(mrb_state *mrb, mrb_value x) #endif } +/* 15.2.8.3.4 */ +/* 15.2.9.3.4 */ +/* + * call-seq: + * num / other -> num + * + * Performs division: the class of the resulting object depends on + * the class of <code>num</code> and on the magnitude of the + * result. + */ + /* 15.2.9.3.19(x) */ /* * call-seq: |
