Project

General

Profile

Actions

Backport #3754

closed

Integer("08") raises ArgumentError

Added by bj (Björn Engelmann) over 13 years ago. Updated almost 13 years ago.

Status:
Rejected
Assignee:
-
[ruby-core:31907]

Description

=begin
Integer("08") and Integer("09") raise an ArgumentError while all other digits (f.i. Integer("05")) do not.
=end

Actions #1

Updated by runpaint (Run Paint Run Run) over 13 years ago

=begin
The 0 prefix denotes an octal number, the same as with Integer literals. Therefore, this is spec. as neither 8 nor 9 are valid digits in base 8.

Integer '0245'
=> 165
0245
=> 165
=end

Actions #2

Updated by naruse (Yui NARUSE) over 13 years ago

  • Status changed from Open to Rejected

=begin

=end

Actions #3

Updated by nobu (Nobuyoshi Nakada) over 13 years ago

=begin
You can write as following in 1.9:
Integer("08", 10) => 8
=end

Actions

Also available in: Atom PDF

Like0
Like0Like0Like0