readflt.c: small style modifications.

This commit is contained in:
Yukihiro "Matz" Matsumoto
2022-08-29 15:14:46 +09:00
parent dfeda0acc8
commit 0645c4536b
+11 -10
View File
@@ -51,7 +51,8 @@ mrb_float_read(const char *str, char **end)
++n;
}
a = p;
} else if (*p != '.')
}
else if (*p != '.')
goto done;
d *= sign;
@@ -61,15 +62,14 @@ mrb_float_read(const char *str, char **end)
double base = 0.1;
++p;
if (ISDIGIT(*p))
{
while (*p && ISDIGIT(*p)) {
f += base * (*p - '0') ;
base /= 10.0;
++p;
++n;
}
if (ISDIGIT(*p)) {
while (*p && ISDIGIT(*p)) {
f += base * (*p - '0') ;
base /= 10.0;
++p;
++n;
}
}
d += f * sign;
a = p;
}
@@ -83,7 +83,8 @@ mrb_float_read(const char *str, char **end)
if (*p == '-') {
sign = -1;
++p;
} else if (*p == '+')
}
else if (*p == '+')
++p;
if (ISDIGIT(*p)) {