aboutsummaryrefslogtreecommitdiffstats
path: root/ext
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-10-04 00:55:15 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-10-04 00:55:15 +0000
commitc6f0e312be4284607411b66db68ed46f083a5de8 (patch)
tree1d1b42e4796061ff14c20b8631970a47f6b9cb95 /ext
parentcdd10ca17fffd433d7a0e42670f7bf65985eacdc (diff)
downloadruby-c6f0e312be4284607411b66db68ed46f083a5de8.tar.gz
bigdecimal.c: more precision
* ext/bigdecimal/bigdecimal.c (BigDecimal_div2): need more room for precision to round. [ruby-core:77475] [Bug #12805] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56336 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext')
-rw-r--r--ext/bigdecimal/bigdecimal.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/ext/bigdecimal/bigdecimal.c b/ext/bigdecimal/bigdecimal.c
index 8f41c725f8..623bd11cee 100644
--- a/ext/bigdecimal/bigdecimal.c
+++ b/ext/bigdecimal/bigdecimal.c
@@ -1533,7 +1533,7 @@ BigDecimal_div2(VALUE self, VALUE b, VALUE n)
size_t mx = ix + VpBaseFig()*2;
size_t pl = VpSetPrecLimit(0);
- GUARD_OBJ(cv, VpCreateRbObject(mx, "0"));
+ GUARD_OBJ(cv, VpCreateRbObject(mx + VpBaseFig(), "0"));
GUARD_OBJ(av, GetVpValue(self, 1));
GUARD_OBJ(bv, GetVpValue(b, 1));
mx = av->Prec + bv->Prec + 2;