[#68478] Looking for MRI projects for Ruby Google Summer of Code 2015 — Tony Arcieri <bascule@...>
Hi ruby-core,
10 messages
2015/03/10
[#68480] Re: Looking for MRI projects for Ruby Google Summer of Code 2015
— SASADA Koichi <ko1@...>
2015/03/10
I have.
[#68549] Re: Looking for MRI projects for Ruby Google Summer of Code 2015
— SASADA Koichi <ko1@...>
2015/03/17
I sent several ideas on previous, mail, but they are seems rejected?
[#68493] [Ruby trunk - Feature #10532] [PATCH] accept_nonblock supports "exception: false" — nobu@...
Issue #10532 has been updated by Nobuyoshi Nakada.
5 messages
2015/03/11
[#68503] Re: [Ruby trunk - Feature #10532] [PATCH] accept_nonblock supports "exception: false"
— Eric Wong <normalperson@...>
2015/03/12
Committed as r49948.
[#68504] Re: [Ruby trunk - Feature #10532] [PATCH] accept_nonblock supports "exception: false"
— Nobuyoshi Nakada <nobu@...>
2015/03/12
On 2015/03/12 12:08, Eric Wong wrote:
[#68506] Seven stacks (and two questions) — Jakub Trzebiatowski <jaktrze1@...>
The Ruby Hacking Guide says that Ruby has窶ヲ seven stacks. Is it an implementation choice (and it could be implemented with one stack), or is there really a need for seven logical stacks? For example, Lua has one stack, and still closures with upvalues are totally possible (it窶冱 like Ruby窶冱 blocks that can reference local variables of their enclosing method, but it works for any function with any upvalues).
5 messages
2015/03/12
[#68520] Possible regression in 2.1 and 2.2 in binding when combined with delegate? — Joe Swatosh <joe.swatosh@...>
# The following code
3 messages
2015/03/14
[#68604] GSOC project Cross-thread Fiber support — surya pratap singh raghuvanshi <oshosurya@...>
- *hi i am a third year computer science student interested in working
6 messages
2015/03/22
[#68606] Re: GSOC project Cross-thread Fiber support
— Tony Arcieri <bascule@...>
2015/03/22
Hi Surya,
[#68619] Re: GSOC project Cross-thread Fiber support
— surya pratap singh raghuvanshi <oshosurya@...>
2015/03/23
hi tony,
[ruby-core:68541] [Ruby trunk - Bug #10979] [Open] Hash fails to distinguish 0.0 & -0.0
From:
avondrak@...
Date:
2015-03-17 00:25:16 UTC
List:
ruby-core #68541
Issue #10979 has been reported by Alex Vondrak.
----------------------------------------
Bug #10979: Hash fails to distinguish 0.0 & -0.0
https://bugs.ruby-lang.org/issues/10979
* Author: Alex Vondrak
* Status: Open
* Priority: Normal
* Assignee:
* ruby -v: ruby 2.2.0p0 (2014-12-25 revision 49005) [x86_64-darwin13]
* Backport: 2.0.0: UNKNOWN, 2.1: UNKNOWN, 2.2: UNKNOWN
----------------------------------------
According to the docs ( http://ruby-doc.org/core-2.2.1/Hash.html ):
> Two objects refer to the same hash key when their hash value is identical and the two objects are eql? to each other.
However, that does not appear to be the case for 0.0 and -0.0:
~~~
$ irb
2.2.0 :001 > (0.0).hash
=> -204267982040607835
2.2.0 :002 > (-0.0).hash
=> -204267982040607835
2.2.0 :003 > (0.0).eql?(-0.0)
=> true
2.2.0 :004 > (-0.0).eql?(0.0)
=> true
2.2.0 :005 > { 0.0 => :positive }.has_key?(-0.0)
=> false
2.2.0 :006 > { -0.0 => :negative }.has_key?(0.0)
=> false
2.2.0 :007 > { 0.0 => :positive }[-0.0]
=> nil
2.2.0 :008 > { -0.0 => :negative }[0.0]
=> nil
2.2.0 :009 > { 0.0 => :positive }.keys.map(&:hash)
=> [-204267982040607835]
2.2.0 :010 > { -0.0 => :negative }.keys.map(&:hash)
=> [-204267982040607835]
~~~
I realize that floating point numbers are weird, and that 0.0 & -0.0 aren't literally the same machine representation. However, they *are* #eql? to each other have the same hash codes. I figure either the docs are misleading or there's a bug in the Hash primitives.
This also has carry-over effects to Array differences, for example:
~~~
$ irb
2.2.0 :001 > [0.0] - [-0.0]
=> [0.0]
2.2.0 :002 > [-0.0] - [0.0]
=> [-0.0]
2.2.0 :003 > [0.0, -0.0] - [-0.0]
=> [0.0]
~~~
This was the initial behavior I observed in Ruby 2.1.3 that led me to file this bug. I tried Ruby 2.2.0 and the same behavior still seems to persist.
--
https://bugs.ruby-lang.org/