Further refactoring over #4738

parent c5d500d5
...@@ -1004,10 +1004,8 @@ retry: ...@@ -1004,10 +1004,8 @@ retry:
case 'A': { case 'A': {
mrb_value val = GETARG(); mrb_value val = GETARG();
double fval; double fval;
mrb_int i;
mrb_int need = 6; mrb_int need = 6;
char fbuf[32]; char fbuf[32];
int frexp_result;
fval = mrb_float(mrb_Float(mrb, val)); fval = mrb_float(mrb_Float(mrb, val));
if (!isfinite(fval)) { if (!isfinite(fval)) {
...@@ -1051,8 +1049,8 @@ retry: ...@@ -1051,8 +1049,8 @@ retry:
fmt_setup(fbuf, sizeof(fbuf), *p, flags, width, prec); fmt_setup(fbuf, sizeof(fbuf), *p, flags, width, prec);
need = 0; need = 0;
if (*p != 'e' && *p != 'E') { if (*p != 'e' && *p != 'E') {
frexp(fval, &frexp_result); int i;
i = (mrb_int)frexp_result; frexp(fval, &i);
if (i > 0) if (i > 0)
need = BIT_DIGITS(i); need = BIT_DIGITS(i);
} }
......
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