diff options
author | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2006-09-21 22:52:38 +0000 |
---|---|---|
committer | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2006-09-21 22:52:38 +0000 |
commit | 51281b961be085be5a29088ada5118699035306b (patch) | |
tree | d5adc6176aa167e868d3c6081e794238b98251ac /numeric.c | |
parent | 5b950717b7bbcf8fa3b9362060c02badd87d2b5a (diff) | |
download | ruby-51281b961be085be5a29088ada5118699035306b.tar.gz |
* bignum.c (rb_big_hash): use rb_memhash().
* numeric.c (flo_hash): simplified. klass need not to affect
resulting hash value.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10992 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'numeric.c')
-rw-r--r-- | numeric.c | 4 |
1 files changed, 1 insertions, 3 deletions
@@ -839,9 +839,7 @@ flo_hash(VALUE num) int hash; d = RFLOAT(num)->value; - if (d == 0) d = fabs(d); - hash = rb_memhash(&d, sizeof(d)) ^ RBASIC(num)->klass; - if (hash < 0) hash = -hash; + hash = rb_memhash(&d, sizeof(d)); return INT2FIX(hash); } |