summaryrefslogtreecommitdiff
path: root/ext/bigdecimal/bigdecimal.c
diff options
context:
space:
mode:
authormrkn <mrkn@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-11-22 13:31:26 +0000
committermrkn <mrkn@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-11-22 13:31:26 +0000
commit909d14a1dbd94e6133b3df5fc80e114fec655fa9 (patch)
tree96e75320d4d0ad5d5e6783d25377a7347fb6bcc8 /ext/bigdecimal/bigdecimal.c
parent95a6be1a177976e75e06c1a8f55b438898bee3a2 (diff)
* ext/bigdecimal/bigdecimal.c (BigDecimal_power):
Round the result value only if the precision is given. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43803 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/bigdecimal/bigdecimal.c')
-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 0ed5147..f630c0a 100644
--- a/ext/bigdecimal/bigdecimal.c
+++ b/ext/bigdecimal/bigdecimal.c
@@ -2383,7 +2383,7 @@ retry:
GUARD_OBJ(y, VpCreateRbObject(1, "0"));
}
VpPower(y, x, int_exp);
- if (VpIsDef(y)) {
+ if (!NIL_P(prec) && VpIsDef(y)) {
VpMidRound(y, VpGetRoundMode(), n);
}
return ToValue(y);