summaryrefslogtreecommitdiffhomepage
path: root/mrbgems/mruby-rational
diff options
context:
space:
mode:
authorYukihiro "Matz" Matsumoto <[email protected]>2021-01-28 08:47:16 +0900
committerYukihiro "Matz" Matsumoto <[email protected]>2021-01-28 08:47:16 +0900
commit2e33c2d120b5487e9be2ef9881b41329c4eeabcd (patch)
tree8aa2956669b0a0fd3c7bbb6ce5ae70dc907f7de2 /mrbgems/mruby-rational
parentf5e10e294cbd2d723d263e038d4cb8cc6e84d6b6 (diff)
downloadmruby-2e33c2d120b5487e9be2ef9881b41329c4eeabcd.tar.gz
mruby-2e33c2d120b5487e9be2ef9881b41329c4eeabcd.zip
Remove unnecessary bit shift in `rational_new_f`.
Diffstat (limited to 'mrbgems/mruby-rational')
-rw-r--r--mrbgems/mruby-rational/src/rational.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/mrbgems/mruby-rational/src/rational.c b/mrbgems/mruby-rational/src/rational.c
index 931f92d21..9081c2eec 100644
--- a/mrbgems/mruby-rational/src/rational.c
+++ b/mrbgems/mruby-rational/src/rational.c
@@ -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);