summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorazav <azav@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-07-25 15:18:37 +0000
committerazav <azav@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-07-25 15:18:37 +0000
commita34dc9dc148d16d290961b8c477fb5ed103140c7 (patch)
treef0b630e3c1181832ebff640e0d292ec2008fe6ec
parentc689ee1a89feb9d5acebb7a6092aef23af3cf35b (diff)
* ext/bigdecimal.c: moved BASE_FIG definition before it is used first time.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24274 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ext/bigdecimal/bigdecimal.c36
1 files changed, 18 insertions, 18 deletions
diff --git a/ext/bigdecimal/bigdecimal.c b/ext/bigdecimal/bigdecimal.c
index 0b2ac34b15..c917e84090 100644
--- a/ext/bigdecimal/bigdecimal.c
+++ b/ext/bigdecimal/bigdecimal.c
@@ -39,6 +39,24 @@ VALUE rb_cBigDecimal;
#define SAVE(p) PUSH(p->obj);
#define GUARD_OBJ(p,y) {p=y;SAVE(p);}
+#ifndef BASE_FIG
+static U_LONG BASE_FIG = 4; /* =log10(BASE) */
+static U_LONG BASE = 10000L; /* Base value(value must be 10**BASE_FIG) */
+ /* The value of BASE**2 + BASE must be represented */
+ /* within one U_LONG. */
+static U_LONG HALF_BASE = 5000L;/* =BASE/2 */
+static U_LONG BASE1 = 1000L; /* =BASE/10 */
+#else
+#ifndef BASE
+#error BASE_FIG is defined but BASE is not
+#endif
+#define HALF_BASE (BASE/2)
+#define BASE1 (BASE/10)
+#endif
+#ifndef DBLE_FIG
+#define DBLE_FIG (DBL_DIG+1) /* figure of double */
+#endif
+
/*
* ================== Ruby Interface part ==========================
*/
@@ -2062,24 +2080,6 @@ static int gfCheckVal = 1; /* Value checking flag in VpNmlz() */
static U_LONG gnPrecLimit = 0; /* Global upper limit of the precision newly allocated */
static U_LONG gfRoundMode = VP_ROUND_HALF_UP; /* Mode for general rounding operation */
-#ifndef BASE_FIG
-static U_LONG BASE_FIG = 4; /* =log10(BASE) */
-static U_LONG BASE = 10000L; /* Base value(value must be 10**BASE_FIG) */
- /* The value of BASE**2 + BASE must be represented */
- /* within one U_LONG. */
-static U_LONG HALF_BASE = 5000L;/* =BASE/2 */
-static U_LONG BASE1 = 1000L; /* =BASE/10 */
-#else
-#ifndef BASE
-#error BASE_FIG is defined but BASE is not
-#endif
-#define HALF_BASE (BASE/2)
-#define BASE1 (BASE/10)
-#endif
-#ifndef DBLE_FIG
-#define DBLE_FIG (DBL_DIG+1) /* figure of double */
-#endif
-
static Real *VpConstOne; /* constant 1.0 */
static Real *VpPt5; /* constant 0.5 */
#define maxnr 100UL /* Maximum iterations for calcurating sqrt. */