summaryrefslogtreecommitdiff
path: root/object.c
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2005-08-04 04:31:33 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2005-08-04 04:31:33 +0000
commit53b4c2b87a9c6832e663cf5773a8aca9a1cf3341 (patch)
tree6448711f10de49e5cae0bd6c3f8531c3cac90b6d /object.c
parenta767a76ad132befbf1cf39619c55c993c854157a (diff)
* numeric.c (fix_div): should not convert the result into
integer. [ruby-core:05524] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@8905 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'object.c')
-rw-r--r--object.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/object.c b/object.c
index d41f3570fd..436469ab40 100644
--- a/object.c
+++ b/object.c
@@ -2094,6 +2094,18 @@ rb_to_integer(val, method)
}
VALUE
+rb_check_to_integer(val, method)
+ VALUE val;
+ char *method;
+{
+ VALUE v = convert_type(val, "Integer", method, Qfalse);
+ if (!rb_obj_is_kind_of(v, rb_cInteger)) {
+ return Qnil;
+ }
+ return v;
+}
+
+VALUE
rb_to_int(val)
VALUE val;
{