Project

General

Profile

Actions

Bug #1821

closed

Incorrect -0.0.hash

Added by TPReal (Tomasz Błajek) over 14 years ago. Updated almost 13 years ago.

Status:
Closed
Assignee:
-
ruby -v:
ruby 1.9.1p0 (2009-01-30 revision 21907) [i386-mswin32]
[ruby-core:24577]

Description

=begin
In the rdoc to Object#hash (http://ruby-doc.org/core/classes/Object.html#M000337) we read: "This function must have the property that a.eql?(b) implies a.hash == b.hash."

The value of -0.0.hash is inconsistent with the above contract:

z=0.0
nz=-0.0
z.eql?(nz) #=> true
z.hash #=> 1041500564
nz.hash #=> -434138511
=end

Actions #1

Updated by yugui (Yuki Sonoda) over 14 years ago

  • Status changed from Open to Closed
  • % Done changed from 0 to 100

=begin
Applied in changeset r24458.
=end

Actions

Also available in: Atom PDF

Like0
Like0