diff options
| author | Cremno <[email protected]> | 2013-08-07 20:48:23 +0200 |
|---|---|---|
| committer | Cremno <[email protected]> | 2013-08-07 20:48:23 +0200 |
| commit | 123c88759cea8561126a156524355e29e0a439f7 (patch) | |
| tree | a3169c85ed1fcb76963fbedfda0f88cf96a555f0 /src/numeric.c | |
| parent | 1f5c91d68dfca9a7000f2b194efceed9b96ffdf6 (diff) | |
| download | mruby-123c88759cea8561126a156524355e29e0a439f7.tar.gz mruby-123c88759cea8561126a156524355e29e0a439f7.zip | |
class.c and numeric.c: fixed MSVC 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--; |
