summaryrefslogtreecommitdiff
path: root/bignum.c
diff options
context:
space:
mode:
authorzzak <zzak@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-07-15 02:13:13 +0000
committerzzak <zzak@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-07-15 02:13:13 +0000
commitb39b66f4aaa662f4739748377d6a172e1acd1601 (patch)
tree14fa26dbfa35c15982ee20177d65bc0df0d4f63f /bignum.c
parente068834b5c38025c8633e5c72b57afcfd9dd4d56 (diff)
* 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 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41979 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'bignum.c')
-rw-r--r--bignum.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/bignum.c b/bignum.c
index d9120f8e61..5cbd80f5c5 100644
--- a/bignum.c
+++ b/bignum.c
@@ -5898,7 +5898,17 @@ rb_big_hash(VALUE x)
}
/*
- * 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