Export `mrb_int_value` that converts `mrb_float` to `Fixnum`.
Or `Float` if `mrb_float` value is too big (or too small) to fit in
`mrb_int`. The `_int_` in `mrb_int_value` means `Integral` module, which
represents integer-like values in mruby.
MODIFY
include/mruby/numeric.h
include/mruby/numeric.h
@@ -34,6 +34,7 @@ MRB_API mrb_value mrb_fixnum_to_str(mrb_state *mrb, mrb_value x, mrb_int base);
#ifndef MRB_WITHOUT_FLOAT
MRB_API mrb_value mrb_float_to_str(mrb_state *mrb, mrb_value x, const char *fmt);
MRB_API mrb_float mrb_to_flo(mrb_state *mrb, mrb_value x);
+MRB_API mrb_value mrb_int_value(mrb_state *mrb, mrb_float f);
#endif
MRB_API mrb_value mrb_num_plus(mrb_state *mrb, mrb_value x, mrb_value y);

MODIFY
src/numeric.c
src/numeric.c
@@ -45,7 +45,7 @@ mrb_to_flo(mrb_state *mrb, mrb_value val)
return mrb_float(val);
}
-static mrb_value
+MRB_API mrb_value
mrb_int_value(mrb_state *mrb, mrb_float f)
{
if (FIXABLE_FLOAT(f)) {

Export `mrb_int_value` that converts `mrb_float` to `Fixnum`.

Or `Float` if `mrb_float` value is too big (or too small) to fit in
`mrb_int`. The `_int_` in `mrb_int_value` means `Integral` module, which
represents integer-like values in mruby.