summaryrefslogtreecommitdiff
path: root/ext
diff options
context:
space:
mode:
authorshigek <shigek@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2003-07-01 14:14:18 +0000
committershigek <shigek@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2003-07-01 14:14:18 +0000
commit49298086d087812225d7d54d8e693d2ff8983129 (patch)
tree6019dd36e6be2c06b38a6c0c986aaa5a8f577e94 /ext
parente8aa990f92e2a150114138ebcb7b7b789736be65 (diff)
Precision for '**' enhanced (bug).
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4022 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext')
-rw-r--r--ext/bigdecimal/bigdecimal.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/ext/bigdecimal/bigdecimal.c b/ext/bigdecimal/bigdecimal.c
index b8b1a068e2..4a04d2a94a 100644
--- a/ext/bigdecimal/bigdecimal.c
+++ b/ext/bigdecimal/bigdecimal.c
@@ -3891,7 +3891,7 @@ VpPower(Real *y, Real *x, S_INT n)
/* Allocate working variables */
- w1 = VpAlloc((x->Prec + 2) * BASE_FIG, "#0");
+ w1 = VpAlloc((y->MaxPrec + 2) * BASE_FIG, "#0");
w2 = VpAlloc((w1->MaxPrec * 2 + 1) * BASE_FIG, "#0");
/* calculation start */
@@ -3900,7 +3900,7 @@ VpPower(Real *y, Real *x, S_INT n)
while(n > 0) {
VpAsgn(w1, x, 1);
s = 1;
-loop1: ss = s;
+loop1: ss = s;
s += s;
if(s >(U_LONG) n) goto out_loop1;
VpMult(w2, w1, w1);