[前][次][番号順一覧][スレッド一覧]

ruby-changes:12348

From: nobu <ko1@a...>
Date: Sun, 12 Jul 2009 23:30:50 +0900 (JST)
Subject: [ruby-changes:12348] Ruby:r24043 (trunk): * object.c (rb_to_integer, rb_check_to_integer): return Bignum

nobu	2009-07-12 23:30:32 +0900 (Sun, 12 Jul 2009)

  New Revision: 24043

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=24043

  Log:
    * object.c (rb_to_integer, rb_check_to_integer): return Bignum
      as-is.

  Modified files:
    trunk/ChangeLog
    trunk/object.c

Index: ChangeLog
===================================================================
--- ChangeLog	(revision 24042)
+++ ChangeLog	(revision 24043)
@@ -1,3 +1,8 @@
+Sun Jul 12 23:30:26 2009  Nobuyoshi Nakada  <nobu@r...>
+
+	* object.c (rb_to_integer, rb_check_to_integer): return Bignum
+	  as-is.
+
 Sun Jul 12 21:07:46 2009  Tadayoshi Funaba  <tadf@d...>
 
 	* complex.c: use k_exact_{zero,one}_p macro.
Index: object.c
===================================================================
--- object.c	(revision 24042)
+++ object.c	(revision 24043)
@@ -2057,6 +2057,7 @@
     VALUE v;
 
     if (FIXNUM_P(val)) return val;
+    if (TYPE(val) == T_BIGNUM) return val;
     v = convert_type(val, "Integer", method, Qtrue);
     if (!rb_obj_is_kind_of(v, rb_cInteger)) {
 	const char *cname = rb_obj_classname(val);
@@ -2072,6 +2073,7 @@
     VALUE v;
 
     if (FIXNUM_P(val)) return val;
+    if (TYPE(val) == T_BIGNUM) return val;
     v = convert_type(val, "Integer", method, Qfalse);
     if (!rb_obj_is_kind_of(v, rb_cInteger)) {
 	return Qnil;

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]