ruby-changes:38857
From: nobu <ko1@a...>
Date: Wed, 17 Jun 2015 21:12:11 +0900 (JST)
Subject: [ruby-changes:38857] nobu:r50938 (trunk): bignum.c: doc of rb_cstr_to_inum
nobu 2015-06-17 21:11:53 +0900 (Wed, 17 Jun 2015) New Revision: 50938 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=50938 Log: bignum.c: doc of rb_cstr_to_inum * bignum.c (rb_cstr_to_inum): [DOC] add document of the function. Modified files: trunk/bignum.c Index: bignum.c =================================================================== --- bignum.c (revision 50937) +++ bignum.c (revision 50938) @@ -3940,6 +3940,22 @@ str2big_gmp( https://github.com/ruby/ruby/blob/trunk/bignum.c#L3940 } #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) { -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/