diff options
| author | shigek <shigek@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2003-07-01 14:14:18 +0000 |
|---|---|---|
| committer | shigek <shigek@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2003-07-01 14:14:18 +0000 |
| commit | f0d232d54825e437678badb51885adebe188dd5d (patch) | |
| tree | 6019dd36e6be2c06b38a6c0c986aaa5a8f577e94 | |
| parent | ff397f89b03eda01b5366e5ccb3610c2075e012e (diff) | |
| download | ruby-f0d232d54825e437678badb51885adebe188dd5d.tar.gz ruby-f0d232d54825e437678badb51885adebe188dd5d.tar.xz ruby-f0d232d54825e437678badb51885adebe188dd5d.zip | |
Precision for '**' enhanced (bug).
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@4022 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
| -rw-r--r-- | ext/bigdecimal/bigdecimal.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/ext/bigdecimal/bigdecimal.c b/ext/bigdecimal/bigdecimal.c index b8b1a068e..4a04d2a94 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); |
