mirror of
https://github.com/mruby/mruby
synced 2026-06-08 16:11:16 +00:00
numeric.c: mrb_float_to_integer can return a big integer.
This commit is contained in:
@@ -1571,7 +1571,11 @@ mrb_float_to_integer(mrb_state *mrb, mrb_value x)
|
||||
z = (mrb_int)d;
|
||||
}
|
||||
else {
|
||||
#ifdef MRB_USE_BIGINT
|
||||
return mrb_bint_new_float(mrb, d);
|
||||
#else
|
||||
mrb_raisef(mrb, E_RANGE_ERROR, "number (%v) too big for integer", x);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
return mrb_int_value(mrb, z);
|
||||
|
||||
Reference in New Issue
Block a user