summaryrefslogtreecommitdiffhomepage
path: root/src/numeric.c
diff options
context:
space:
mode:
authorYukihiro "Matz" Matsumoto <[email protected]>2014-02-23 20:41:15 +0900
committerYukihiro "Matz" Matsumoto <[email protected]>2014-02-23 20:41:15 +0900
commit46ee88357490874d22c4767ddf8c1982b02b61a0 (patch)
tree0ab65b50cf070698ee75e8e2e12d024b89221a39 /src/numeric.c
parente202d4cd530bfc660688da6316e33100b551ed83 (diff)
downloadmruby-46ee88357490874d22c4767ddf8c1982b02b61a0.tar.gz
mruby-46ee88357490874d22c4767ddf8c1982b02b61a0.zip
move declaration to the top of the block; ref #1727
Diffstat (limited to 'src/numeric.c')
-rw-r--r--src/numeric.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/numeric.c b/src/numeric.c
index a8c483148..ec7f05b97 100644
--- a/src/numeric.c
+++ b/src/numeric.c
@@ -136,6 +136,7 @@ mrb_flo_to_str(mrb_state *mrb, mrb_value flo)
mrb_bool e = FALSE;
char s[48];
char *c = &s[0];
+ int length = 0;
if (n < 0) {
n = -n;
@@ -145,7 +146,6 @@ mrb_flo_to_str(mrb_state *mrb, mrb_value flo)
exp = (n > 1) ? floor(log10(n)) : -ceil(-log10(n));
/* preserve significands */
- int length = 0;
if (exp < 0) {
int i, beg = -1, end = 0;
double f = n;