
Issue #19733 has been reported by sawa (Tsuyoshi Sawada). ---------------------------------------- Bug #19733: Kernel#Rational does not accept prefix 0 https://bugs.ruby-lang.org/issues/19733 * Author: sawa (Tsuyoshi Sawada) * Status: Open * Priority: Normal * Backport: 3.0: UNKNOWN, 3.1: UNKNOWN, 3.2: UNKNOWN ---------------------------------------- `Integer` and `Rational` literals accept prefix `0`. There is no difference in this respect. ```ruby 0b10 # => 2 0b10r # => (2/1) ``` However, when it comes to `Kernel#Integer` and `Kernel#Rational`, the former accept prefix `0` while the latter does not. This is confusing. And as I do not see any reason they should behave differently, I think it is a bug. ```ruby Integer("0b10") # => 2 Rational("0b10") # !> ArgumentError ``` -- https://bugs.ruby-lang.org/