mirror of
https://github.com/mruby/mruby
synced 2026-06-08 16:11:16 +00:00
mruby-rational (int_lshift): exponential may be bigger than int bits
This commit is contained in:
@@ -311,7 +311,7 @@ int_lshift(mrb_state *mrb, mrb_value v, mrb_int n)
|
||||
{
|
||||
if (mrb_integer_p(v)) {
|
||||
mrb_float f = (mrb_float)mrb_integer(v);
|
||||
f *= 1<<n;
|
||||
f *= 1L<<n;
|
||||
if (mrb_int_fit_p(f, mrb_float))
|
||||
return mrb_int_value(mrb, (mrb_int)f);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user