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

ruby-changes:29927

From: zzak <ko1@a...>
Date: Mon, 15 Jul 2013 11:13:22 +0900 (JST)
Subject: [ruby-changes:29927] zzak:r41979 (trunk): * bignum.c (rb_big_coerce): [DOC] Add docs for Bignum#coerce

zzak	2013-07-15 11:13:13 +0900 (Mon, 15 Jul 2013)

  New Revision: 41979

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

  Log:
    * bignum.c (rb_big_coerce): [DOC] Add docs for Bignum#coerce
      Based on patch by Juanito Fatas [Fixes GH-360]
      https://github.com/ruby/ruby/pull/360

  Modified files:
    trunk/ChangeLog
    trunk/bignum.c

Index: ChangeLog
===================================================================
--- ChangeLog	(revision 41978)
+++ ChangeLog	(revision 41979)
@@ -1,3 +1,9 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1
+Mon Jul 15 11:10:46 2013  Zachary Scott  <e@z...>
+
+	* bignum.c (rb_big_coerce): [DOC] Add docs for Bignum#coerce
+	  Based on patch by Juanito Fatas [Fixes GH-360]
+	  https://github.com/ruby/ruby/pull/360
+
 Mon Jul 15 10:56:01 2013  Zachary Scott  <e@z...>
 
 	* thread.c (mutex_sleep): [DOC] Awake thread will reacquire lock
Index: bignum.c
===================================================================
--- bignum.c	(revision 41978)
+++ bignum.c	(revision 41979)
@@ -5898,7 +5898,17 @@ rb_big_hash(VALUE x) https://github.com/ruby/ruby/blob/trunk/bignum.c#L5898
 }
 
 /*
- * MISSING: documentation
+ * call-seq:
+ *   big.coerce(numeric)  ->  array
+ *
+ * Returns an array with both a +numeric+ and a +big+ represented as Bignum
+ * objects.
+ *
+ * This is achieved by converting +numeric+ to a Bignum.
+ *
+ * A TypeError is raised if the +numeric+ is not a Fixnum or Bignum type.
+ *
+ *     (0x3FFFFFFFFFFFFFFF+1).coerce(42)   #=> [42, 4611686018427387904]
  */
 
 static VALUE

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

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