diff options
-rw-r--r-- | ChangeLog | 4 | ||||
-rw-r--r-- | ext/bigdecimal/bigdecimal.c | 5 |
2 files changed, 6 insertions, 3 deletions
@@ -1,3 +1,7 @@ +Sun Feb 1 23:00:00 2004 Shigeo Kobayashi <[email protected]> + * ext/bigdecimal.c: Bug in BigDecimal("1e#{n}").add BigDecimal('.5'),n) + reported and fixed by Javier Goizueta. + Sun Feb 1 05:30:06 2004 Tanaka Akira <[email protected]> * lib/open-uri.rb (URI::Generic#find_proxy): warn HTTP_PROXY. diff --git a/ext/bigdecimal/bigdecimal.c b/ext/bigdecimal/bigdecimal.c index 6a9940d335..0d339c9cfc 100644 --- a/ext/bigdecimal/bigdecimal.c +++ b/ext/bigdecimal/bigdecimal.c @@ -3788,10 +3788,9 @@ VpMidRound(Real *y, int f, int nf) } for(i=0;i<=n;++i) div *= 10; if(div>=BASE) { - y->frac[ix] = 0; if(ix) { - VpNmlz(y); - VpRdup(y,0); + y->frac[ix] = 0; + VpRdup(y,ix); } else { S_INT s = VpGetSign(y); VpSetOne(y); |