Remove unnecessary bit shift in rational_new_f.

This commit is contained in:
Yukihiro "Matz" Matsumoto
2021-01-28 08:47:16 +09:00
parent f5e10e294c
commit 2e33c2d120
+1 -1
View File
@@ -208,7 +208,7 @@ rational_new_f(mrb_state *mrb, mrb_float f0)
if (f == RAT_HUGE_VAL || f > (mrb_float)MRB_INT_MAX) {
rat_overflow(mrb);
}
return rational_new(mrb, ((mrb_int)f)<<n, 1);
return rational_new(mrb, (mrb_uint)f, 1);
}
if (n < -RAT_INT_LIMIT) {
f = ldexp_rat(f, n+RAT_INT_LIMIT);