mirror of
https://github.com/ruby/ruby.git
synced 2025-08-15 21:49:06 +02:00
merges r24361 from trunk into ruby_1_9_1.
-- * numeric.c (flo_hash): normalize -0.0 to 0.0. [ruby-core:24577] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_1@24458 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
04f65b4127
commit
208ec9936a
3 changed files with 8 additions and 1 deletions
|
@ -897,6 +897,8 @@ flo_hash(VALUE num)
|
|||
int hash;
|
||||
|
||||
d = RFLOAT_VALUE(num);
|
||||
/* normalize -0.0 to 0.0 */
|
||||
if (d == 0.0) d = 0.0;
|
||||
hash = rb_memhash(&d, sizeof(d));
|
||||
return INT2FIX(hash);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue