Actions
Bug #13992
closedStrange behaviour for kernel#integer method
Bug #13992:
Strange behaviour for kernel#integer method
Actions
Added by Ursus (Ivan Lasorsa) almost 9 years ago. Updated about 7 years ago.
Yes, it does. Leading zero designates octal number (base 8), which can't have digit "8" in it.
Docu is at:
https://ruby-doc.org/core/Kernel.html#method-i-Integer
Perhaps the octal-notation could also be put into the documentation there.
And an example could be added for octal-input leading to error such as the
above. That would help explain things to newcomers who may be surprised
about the behaviour.