diff options
author | mrkn <mrkn@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2013-11-22 13:31:26 +0000 |
---|---|---|
committer | mrkn <mrkn@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2013-11-22 13:31:26 +0000 |
commit | 909d14a1dbd94e6133b3df5fc80e114fec655fa9 (patch) | |
tree | 96e75320d4d0ad5d5e6783d25377a7347fb6bcc8 | |
parent | 95a6be1a177976e75e06c1a8f55b438898bee3a2 (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
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | ext/bigdecimal/bigdecimal.c | 2 |
2 files changed, 6 insertions, 1 deletions
@@ -1,3 +1,8 @@ +Fri Nov 22 22:30:00 2013 Kenta Murata <mrkn@mrkn.jp> + + * ext/bigdecimal/bigdecimal.c (BigDecimal_power): + Round the result value only if the precision is given. + Fri Nov 22 17:20:50 2013 NARUSE, Yui <naruse@ruby-lang.org> * transcode.c (str_transcode0): don't scrub invalid chars if diff --git a/ext/bigdecimal/bigdecimal.c b/ext/bigdecimal/bigdecimal.c index 0ed5147c9d..f630c0a167 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); |