summaryrefslogtreecommitdiffhomepage
path: root/mrbgems/mruby-rational
diff options
context:
space:
mode:
authorYukihiro "Matz" Matsumoto <[email protected]>2020-11-04 14:18:47 +0900
committerYukihiro "Matz" Matsumoto <[email protected]>2020-11-04 14:18:47 +0900
commit0113db6716f5ede302e2fca2e0888107ce15eb07 (patch)
treeb94e315e526b0eddb38c5816afccad9d6151acf2 /mrbgems/mruby-rational
parentb77a0f69a3c177aeaaf009395aade36675dc7514 (diff)
downloadmruby-0113db6716f5ede302e2fca2e0888107ce15eb07.tar.gz
mruby-0113db6716f5ede302e2fca2e0888107ce15eb07.zip
Add cast to silence int conversion warnings.
Diffstat (limited to 'mrbgems/mruby-rational')
-rw-r--r--mrbgems/mruby-rational/src/rational.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/mrbgems/mruby-rational/src/rational.c b/mrbgems/mruby-rational/src/rational.c
index d5dd7adc4..a35f2f023 100644
--- a/mrbgems/mruby-rational/src/rational.c
+++ b/mrbgems/mruby-rational/src/rational.c
@@ -119,11 +119,11 @@ rational_new_f(mrb_state *mrb, mrb_float f0)
/* continued fraction and check denominator each step */
for (i = 0; i < 64; i++) {
- a = n ? d / n : 0;
+ a = (mrb_int)(n ? d / n : 0);
if (i && !a) break;
-
- x = d; d = n; n = x % n;
-
+
+ x = d; d = (mrb_int)n; n = x % n;
+
x = a;
if (k[1] * a + k[0] >= md) {
x = (md - k[0]) / k[1];