summaryrefslogtreecommitdiffhomepage
path: root/include
diff options
context:
space:
mode:
authorYukihiro "Matz" Matsumoto <[email protected]>2021-12-31 15:14:37 +0900
committerYukihiro "Matz" Matsumoto <[email protected]>2021-12-31 15:14:37 +0900
commitb9e1b9b32852e2fb5836c1d4fd622a5a9a41119e (patch)
tree7a0be15fff89343b2ab112268db3293c53bf071d /include
parent566a8d3fcb9e17c463e63927084112532bc09c0d (diff)
downloadmruby-b9e1b9b32852e2fb5836c1d4fd622a5a9a41119e.tar.gz
mruby-b9e1b9b32852e2fb5836c1d4fd622a5a9a41119e.zip
numeric.c: merge `mrb_as_float` implementation to `mrb_ensure_float_type`.
Since they are basically duplicated functionality. `mrb_as_float` is now a macro defined using `mrb_ensure_float_type`; #5620
Diffstat (limited to 'include')
-rw-r--r--include/mruby.h1
-rw-r--r--include/mruby/numeric.h1
2 files changed, 1 insertions, 1 deletions
diff --git a/include/mruby.h b/include/mruby.h
index 465c944fd..806ceaff6 100644
--- a/include/mruby.h
+++ b/include/mruby.h
@@ -1270,6 +1270,7 @@ MRB_API mrb_bool mrb_obj_equal(mrb_state *mrb, mrb_value a, mrb_value b);
MRB_API mrb_bool mrb_equal(mrb_state *mrb, mrb_value obj1, mrb_value obj2);
#ifndef MRB_NO_FLOAT
MRB_API mrb_value mrb_ensure_float_type(mrb_state *mrb, mrb_value val);
+#define mrb_as_float(mrb, x) mrb_float(mrb_ensure_float_type(mrb, x))
/* obsolete: use mrb_ensure_float_type() instead */
#define mrb_to_float(mrb, val) mrb_ensure_float_type(mrb, val)
#endif
diff --git a/include/mruby/numeric.h b/include/mruby/numeric.h
index 4b14588ac..aec46413c 100644
--- a/include/mruby/numeric.h
+++ b/include/mruby/numeric.h
@@ -160,7 +160,6 @@ mrb_int_mul_overflow(mrb_int a, mrb_int b, mrb_int *c)
# endif /* MRB_USE_FLOAT32 */
MRB_API mrb_value mrb_float_to_integer(mrb_state *mrb, mrb_value val);
-MRB_API mrb_float mrb_as_float(mrb_state *mrb, mrb_value x);
/* internal functions */
mrb_float mrb_div_float(mrb_float x, mrb_float y);