From 49298086d087812225d7d54d8e693d2ff8983129 Mon Sep 17 00:00:00 2001 From: shigek Date: Tue, 1 Jul 2003 14:14:18 +0000 Subject: Precision for '**' enhanced (bug). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4022 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ext/bigdecimal/bigdecimal.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'ext') 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); -- cgit v1.2.3