Project

General

Profile

Actions

Bug #11648

closed

Undocumented features of String#oct

Added by mwpastore (Mike Pastore) over 8 years ago. Updated over 8 years ago.

Status:
Closed
Target version:
-
ruby -v:
ruby 2.2.3p173 (2015-08-18 revision 51636) [x86_64-linux]
[ruby-core:71310]

Description

String#oct will adjust the base of the stringy number being converted to 2 (if prefixed with 0B), 8 (also the default, if prefixed with 0O), 10 (if prefixed with 0D), or 16 (if prefixed with 0X). Much to my surprise this behavior is not documented at ruby-doc.org [1]. Is this the intended behavior and if so should the documentation be updated? If it is not the intended behavior, perhaps String#oct should raise an exception if someone tries to use this undocumented feature?

  1. http://ruby-doc.org/core-2.2.3/String.html#method-i-oct
Actions

Also available in: Atom PDF

Like0
Like0Like0