diff options
author | shigek <shigek@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2003-06-29 13:20:08 +0000 |
---|---|---|
committer | shigek <shigek@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2003-06-29 13:20:08 +0000 |
commit | a40a92f04c6b3edeede0afcd939c17cff66f7d11 (patch) | |
tree | 2334378f75cf504c9a54a63c962d74982974522e /ext | |
parent | d5f31755fc38100a76e0d89f07951995504a4bf7 (diff) |
Bug in '/' fixed by Tadashi Saito.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4016 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext')
-rw-r--r-- | ext/bigdecimal/bigdecimal.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/ext/bigdecimal/bigdecimal.c b/ext/bigdecimal/bigdecimal.c index f1bd1e2320..b8b1a068e2 100644 --- a/ext/bigdecimal/bigdecimal.c +++ b/ext/bigdecimal/bigdecimal.c @@ -683,8 +683,10 @@ BigDecimal_div(VALUE self, VALUE r) /* c xxxxx r 00000yyyyy ==> (y/b)*BASE >= HALF_BASE */ - /* Round up ? */ - VpInternalRound(c,0,c->frac[c->Prec-1],(VpBaseVal()*res->frac[0])/div->frac[0]); + /* Round */ + if(VpIsDef(c)) { + VpInternalRound(c,0,c->frac[c->Prec-1],(VpBaseVal()*res->frac[0])/div->frac[0]); + } return ToValue(c); } |