diff options
| author | Yukihiro "Matz" Matsumoto <[email protected]> | 2020-11-04 14:18:47 +0900 |
|---|---|---|
| committer | Yukihiro "Matz" Matsumoto <[email protected]> | 2020-11-04 14:18:47 +0900 |
| commit | 0113db6716f5ede302e2fca2e0888107ce15eb07 (patch) | |
| tree | b94e315e526b0eddb38c5816afccad9d6151acf2 /mrbgems | |
| parent | b77a0f69a3c177aeaaf009395aade36675dc7514 (diff) | |
| download | mruby-0113db6716f5ede302e2fca2e0888107ce15eb07.tar.gz mruby-0113db6716f5ede302e2fca2e0888107ce15eb07.zip | |
Add cast to silence int conversion warnings.
Diffstat (limited to 'mrbgems')
| -rw-r--r-- | mrbgems/mruby-rational/src/rational.c | 8 |
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]; |
