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.
This commit is contained in:
Yukihiro "Matz" Matsumoto
2019-05-21 16:08:02 +09:00
parent f6e4145ad9
commit e941cf06a3
2 changed files with 2 additions and 1 deletions
+1 -1
View File
@@ -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)) {