[#83107] Alias Enumerable#include? to Enumerable#includes? — Alberto Almagro <albertoalmagro@...>

Hello,

9 messages 2017/10/04

[ruby-core:83196] [Ruby trunk Bug#13992] Strange behaviour for kernel#integer method

From: ivan.lasorsa@...
Date: 2017-10-10 11:04:51 UTC
List: ruby-core #83196
Issue #13992 has been updated by Ursus (Ivan Lasorsa).


zverok (Victor Shepelev) wrote:
> Yes, it does. Leading zero designates octal number (base 8), which can't have digit "8" in it.

~~~ ruby
Integer('09', 10)
9
~~~

This works as expected. My fault thinking that 10 should be the default base

----------------------------------------
Bug #13992: Strange behaviour for kernel#integer method
https://bugs.ruby-lang.org/issues/13992#change-67139

* Author: Ursus (Ivan Lasorsa)
* Status: Open
* Priority: Normal
* Assignee: 
* Target version: 
* ruby -v: 2.4.1
* Backport: 2.3: UNKNOWN, 2.4: UNKNOWN
----------------------------------------
I tried this one with ruby 2.3.1 and ruby 2.4.1.

~~~ ruby
Integer('04')
4
Integer('05')
5
Integer('08')
ArgumentError: invalid value for Integer(): "08"
Integer('09')
ArgumentError: invalid value for Integer(): "09"
~~~

Does this makes sense?



-- 
https://bugs.ruby-lang.org/

Unsubscribe: <mailto:[email protected]?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>

In This Thread

Prev Next