Commit 18c82d53 authored by Yukihiro "Matz" Matsumoto's avatar Yukihiro "Matz" Matsumoto

Merge pull request #2868 from sgnr/avoid-narrowing-cast-in-flo-round

Avoid a narrowing cast in flo_round under MRB_INT64.
parents 1c2fc94c d6865a9c
......@@ -436,7 +436,7 @@ flo_round(mrb_state *mrb, mrb_value num)
{
double number, f;
mrb_int ndigits = 0;
int i;
mrb_int i;
mrb_get_args(mrb, "|i", &ndigits);
number = mrb_float(num);
......@@ -451,7 +451,7 @@ flo_round(mrb_state *mrb, mrb_value num)
}
f = 1.0;
i = abs(ndigits);
i = ndigits >= 0 ? ndigits : -ndigits;
while (--i >= 0)
f = f*10.0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment