diff options
author | shigek <shigek@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2003-08-27 13:29:23 +0000 |
---|---|---|
committer | shigek <shigek@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2003-08-27 13:29:23 +0000 |
commit | 0ec868314558e7b0583235a3fd363c767bb35ecc (patch) | |
tree | 8b7709332ce232509e038ee06e6764a1c04b7f0d /ext/bigdecimal | |
parent | e1a6b435db5427aefd13fa3ba5f30bdc814fcbe4 (diff) |
Forgot to round '*'.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4450 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/bigdecimal')
-rw-r--r-- | ext/bigdecimal/bigdecimal.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/ext/bigdecimal/bigdecimal.c b/ext/bigdecimal/bigdecimal.c index 099331682b..029c6f4c9d 100644 --- a/ext/bigdecimal/bigdecimal.c +++ b/ext/bigdecimal/bigdecimal.c @@ -2026,7 +2026,7 @@ VpAsgn(Real *c, Real *a, int isw) if(c->Prec < a->Prec) { VpInternalRound(c,n,(n>0)?a->frac[n-1]:0,a->frac[n]); } else { - VpLimitRound(c,0); + VpLimitRound(c,0); } } } else { @@ -2589,12 +2589,13 @@ VpMult(Real *c, Real *a, Real *b) } } } - - VpNmlz(c); /* normalize the result */ if(w != NULL) { /* free work variable */ + VpNmlz(c); VpAsgn(w, c, 1); VpFree(c); c = w; + } else { + VpLimitRound(c,0); } Exit: @@ -3821,7 +3822,8 @@ static int VpLimitRound(Real *c,U_LONG ixDigit) { U_LONG ix = VpGetPrecLimit(); - if(!ix) return 0; + if(!VpNmlz(c)) return -1; + if(!ix) return 0; if(!ixDigit) ixDigit = c->Prec-1; if((ix+BASE_FIG-1)/BASE_FIG > ixDigit+1) return 0; return VpLeftRound(c,VpGetRoundMode(),ix); @@ -3832,7 +3834,6 @@ VpInternalRound(Real *c,int ixDigit,U_LONG vPrev,U_LONG v) { int f = 0; - if(!VpNmlz(c)) return; if(VpLimitRound(c,ixDigit)) return; if(!v) return; |