From 123c88759cea8561126a156524355e29e0a439f7 Mon Sep 17 00:00:00 2001 From: Cremno Date: Wed, 7 Aug 2013 20:48:23 +0200 Subject: class.c and numeric.c: fixed MSVC warnings --- src/numeric.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/numeric.c') 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--; -- cgit v1.2.3