From a34dc9dc148d16d290961b8c477fb5ed103140c7 Mon Sep 17 00:00:00 2001 From: azav Date: Sat, 25 Jul 2009 15:18:37 +0000 Subject: * 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 --- ext/bigdecimal/bigdecimal.c | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) (limited to 'ext') 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. */ -- cgit v1.2.3