summaryrefslogtreecommitdiff
path: root/string.c
diff options
context:
space:
mode:
authorBurdette Lamar <BurdetteLamar@Yahoo.com>2025-11-08 16:27:26 -0600
committerGitHub <noreply@github.com>2025-11-08 17:27:26 -0500
commit79eed1158de4164f72def32093aa31bcac339639 (patch)
tree2728c49cb696bf99fec0c3264207fffa0090e315 /string.c
parent75d25a42e6052b5f5d90d2d4022ae996fee5913a (diff)
[DOC] Tweaks for String#to_i (#15036)
Diffstat (limited to 'string.c')
-rw-r--r--string.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/string.c b/string.c
index 96a693eddc..531b1c5594 100644
--- a/string.c
+++ b/string.c
@@ -7027,12 +7027,13 @@ rb_str_include(VALUE str, VALUE arg)
* to_i(base = 10) -> integer
*
* Returns the result of interpreting leading characters in +self+
- * as an integer in the given +base+ (which must be in (0, 2..36)):
+ * as an integer in the given +base+;
+ * +base+ must be either +0+ or in range <tt>(2..36)</tt>:
*
* '123456'.to_i # => 123456
* '123def'.to_i(16) # => 1195503
*
- * With +base+ zero, string +object+ may contain leading characters
+ * With +base+ zero given, string +object+ may contain leading characters
* to specify the actual base:
*
* '123def'.to_i(0) # => 123
@@ -7052,6 +7053,7 @@ rb_str_include(VALUE str, VALUE arg)
* 'abcdef'.to_i # => 0
* '2'.to_i(2) # => 0
*
+ * Related: see {Converting to Non-String}[rdoc-ref:String@Converting+to+Non--5CString].
*/
static VALUE