diff options
-rw-r--r-- | ChangeLog | 4 | ||||
-rw-r--r-- | numeric.c | 2 |
2 files changed, 6 insertions, 0 deletions
@@ -3,6 +3,10 @@ Mon Aug 3 13:05:22 2009 Nobuyoshi Nakada <nobu@ruby-lang.org> * array.c (rb_ary_{permutation,combination,product}): must not use ary_discard on strings. +Mon Aug 3 06:43:25 2009 Yukihiro Matsumoto <matz@ruby-lang.org> + + * numeric.c (flo_hash): normalize -0.0 to 0.0. [ruby-core:24577] + Mon Aug 3 00:32:00 2009 Nobuyoshi Nakada <nobu@ruby-lang.org> * random.c (rb_random_int): arguments have to be converted to @@ -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); } |