diff options
| author | azav <azav@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2009-07-25 15:18:37 +0000 |
|---|---|---|
| committer | azav <azav@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2009-07-25 15:18:37 +0000 |
| commit | 1415b694fe1b24752510f08c08e6bdf6f4be00d4 (patch) | |
| tree | f0b630e3c1181832ebff640e0d292ec2008fe6ec /ext/bigdecimal | |
| parent | 157e228b816393924d2deb156b514037d7164f6e (diff) | |
| download | ruby-1415b694fe1b24752510f08c08e6bdf6f4be00d4.tar.gz ruby-1415b694fe1b24752510f08c08e6bdf6f4be00d4.tar.xz ruby-1415b694fe1b24752510f08c08e6bdf6f4be00d4.zip | |
* ext/bigdecimal.c: moved BASE_FIG definition before it is used first time.
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@24274 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/bigdecimal')
| -rw-r--r-- | ext/bigdecimal/bigdecimal.c | 36 |
1 files changed, 18 insertions, 18 deletions
diff --git a/ext/bigdecimal/bigdecimal.c b/ext/bigdecimal/bigdecimal.c index 0b2ac34b1..c917e8409 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. */ |
