aboutsummaryrefslogtreecommitdiffstats
path: root/bignum.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-06-17 12:11:53 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-06-17 12:11:53 +0000
commit61da10499f60dc15828d6a9c07e79fb4e19b992d (patch)
tree9d7eb9b30733257f5f3299281e6cdc4152da6ee6 /bignum.c
parent22eb2a4f90af5d927b41f80c88c7d9ae7a45f772 (diff)
downloadruby-61da10499f60dc15828d6a9c07e79fb4e19b992d.tar.gz
bignum.c: doc of rb_cstr_to_inum
* bignum.c (rb_cstr_to_inum): [DOC] add document of the function. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50938 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'bignum.c')
-rw-r--r--bignum.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/bignum.c b/bignum.c
index a962dbac36..17e8f701ff 100644
--- a/bignum.c
+++ b/bignum.c
@@ -3940,6 +3940,22 @@ str2big_gmp(
}
#endif
+/*
+ * Parse +str+ as Ruby Integer, i.e., underscores, 0d and 0b prefixes.
+ *
+ * str: pointer to the string to be parsed.
+ * should be NUL-terminated.
+ * base: base of conversion, must be 2..36, or -36..0.
+ * if +base+ > 0, the conversion is done according to the +base+
+ * and unmatched prefix is parsed as a part of the result if
+ * present.
+ * if +base+ <= 0, the conversion is done according to the
+ * prefix if present, in base <code>-base</code> if +base+ < -1,
+ * or in base 10.
+ * badcheck: if non-zero, +ArgumentError+ is raised when +str+ is not
+ * valid as an Integer. if zero, Fixnum 0 is returned in
+ * that case.
+ */
VALUE
rb_cstr_to_inum(const char *str, int base, int badcheck)
{