1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* ext/bigdecimal/bigdecimal.c (BigDecimal_truncate): return

integer if no optional argument given. [incompatible]

* ext/bigdecimal/bigdecimal.c (BigDecimal_floor): ditto.

* ext/bigdecimal/bigdecimal.c (BigDecimal_ceil): ditto.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20584 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
matz 2008-12-08 16:46:48 +00:00
parent aeec60621a
commit 70cf909fdd
2 changed files with 18 additions and 0 deletions

View file

@ -80,6 +80,15 @@ Fri Dec 5 21:42:44 2008 Tadayoshi Funaba <tadf@dotrb.org>
* complex.c: inpsect should not depend on to_s.
Fri Dec 5 21:18:31 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
* ext/bigdecimal/bigdecimal.c (BigDecimal_truncate): return
integer if no optional argument given. [incompatible]
* ext/bigdecimal/bigdecimal.c (BigDecimal_floor): ditto.
* ext/bigdecimal/bigdecimal.c (BigDecimal_ceil): ditto.
Fri Dec 5 19:06:04 2008 Tanaka Akira <akr@fsij.org>
* lib/open3.rb (Open3.pipeline_start): new method.

View file

@ -1413,6 +1413,9 @@ BigDecimal_truncate(int argc, VALUE *argv, VALUE self)
GUARD_OBJ(c,VpCreateRbObject(mx, "0"));
VpSetPrecLimit(pl);
VpActiveRound(c,a,VP_ROUND_DOWN,iLoc); /* 0: truncate */
if (argc == 0) {
return BigDecimal_to_i(ToValue(c));
}
return ToValue(c);
}
@ -1473,6 +1476,9 @@ BigDecimal_floor(int argc, VALUE *argv, VALUE self)
GUARD_OBJ(c,VpCreateRbObject(mx, "0"));
VpSetPrecLimit(pl);
VpActiveRound(c,a,VP_ROUND_FLOOR,iLoc);
if (argc == 0) {
return BigDecimal_to_i(ToValue(c));
}
return ToValue(c);
}
@ -1517,6 +1523,9 @@ BigDecimal_ceil(int argc, VALUE *argv, VALUE self)
GUARD_OBJ(c,VpCreateRbObject(mx, "0"));
VpSetPrecLimit(pl);
VpActiveRound(c,a,VP_ROUND_CEIL,iLoc);
if (argc == 0) {
return BigDecimal_to_i(ToValue(c));
}
return ToValue(c);
}