diff options
| author | Yukihiro "Matz" Matsumoto <[email protected]> | 2013-08-07 16:22:20 -0700 |
|---|---|---|
| committer | Yukihiro "Matz" Matsumoto <[email protected]> | 2013-08-07 16:22:20 -0700 |
| commit | d2be15423a7fc54f143c517ef6f5a2b1a6e17163 (patch) | |
| tree | a3169c85ed1fcb76963fbedfda0f88cf96a555f0 /src/numeric.c | |
| parent | 1f5c91d68dfca9a7000f2b194efceed9b96ffdf6 (diff) | |
| parent | 123c88759cea8561126a156524355e29e0a439f7 (diff) | |
| download | mruby-d2be15423a7fc54f143c517ef6f5a2b1a6e17163.tar.gz mruby-d2be15423a7fc54f143c517ef6f5a2b1a6e17163.zip | |
Merge pull request #1446 from cremno/casts
MSVC: fix warnings
Diffstat (limited to 'src/numeric.c')
| -rw-r--r-- | src/numeric.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/numeric.c b/src/numeric.c index 4d794f8d8..c309abf89 100644 --- a/src/numeric.c +++ b/src/numeric.c @@ -200,7 +200,7 @@ mrb_flo_to_str(mrb_state *mrb, mrb_value flo, int max_digit) *(c++) = '-'; } - exp = log10(n); + exp = (int)log10(n); if ((exp < 0 ? -exp : exp) > max_digit) { /* exponent representation */ @@ -223,7 +223,7 @@ mrb_flo_to_str(mrb_state *mrb, mrb_value flo, int max_digit) /* puts digits */ while (max_digit >= 0) { mrb_float weight = pow(10.0, m); - digit = floor(n / weight + FLT_EPSILON); + digit = (int)floor(n / weight + FLT_EPSILON); *(c++) = '0' + digit; n -= (digit * weight); max_digit--; |
