summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorshigek <shigek@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2003-07-28 13:47:19 +0000
committershigek <shigek@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2003-07-28 13:47:19 +0000
commitce356b524e0339568ff06f826877a586110fa175 (patch)
treea3f1ff0cd4b0ddb94b1c324ce2a37e00b8067ba2
parent906ab8e25d2e074f3dfd5c49570a674f13a19a42 (diff)
Bug for 2nd arg of round fixed.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4193 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ext/bigdecimal/bigdecimal.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/ext/bigdecimal/bigdecimal.c b/ext/bigdecimal/bigdecimal.c
index a1253e92e7..542f9ab520 100644
--- a/ext/bigdecimal/bigdecimal.c
+++ b/ext/bigdecimal/bigdecimal.c
@@ -936,11 +936,14 @@ BigDecimal_round(int argc, VALUE *argv, VALUE self)
Check_Type(vLoc, T_FIXNUM);
iLoc = FIX2INT(vLoc);
break;
- case 2:
+ case 2:{
+ int sws = sw;
Check_Type(vLoc, T_FIXNUM);
iLoc = FIX2INT(vLoc);
Check_Type(vRound, T_FIXNUM);
sw = VpSetRoundMode(FIX2INT(vRound));
+ VpSetRoundMode(sws);
+ }
break;
}