diff options
author | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2009-08-03 05:15:54 +0000 |
---|---|---|
committer | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2009-08-03 05:15:54 +0000 |
commit | 45cd729f17d6585c00241b230f2f2dd0e5e2db52 (patch) | |
tree | 70fb7df0929be692d36fa92011ef232e7fe270a2 /numeric.c | |
parent | 330be69e4310886cc0d54356b2273113d288d9b1 (diff) | |
download | ruby-45cd729f17d6585c00241b230f2f2dd0e5e2db52.tar.gz |
* numeric.c (flo_hash): normalize -0.0 to 0.0. [ruby-core:24577]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24361 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'numeric.c')
-rw-r--r-- | numeric.c | 2 |
1 files changed, 2 insertions, 0 deletions
@@ -913,6 +913,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); } |