diff options
Diffstat (limited to 'hash.c')
-rw-r--r-- | hash.c | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -142,13 +142,16 @@ rb_any_hash(VALUE a) } else if (FLONUM_P(a)) { /* prevent pathological behavior: [Bug #10761] */ - a = (st_index_t)rb_float_value(a); + return rb_dbl_hash(rb_float_value(a)); } hnum = rb_objid_hash((st_index_t)a); } else if (BUILTIN_TYPE(a) == T_STRING) { hnum = rb_str_hash(a); } + else if (BUILTIN_TYPE(a) == T_FLOAT) { + return rb_dbl_hash(rb_float_value(a)); + } else { hval = rb_hash(a); hnum = FIX2LONG(hval); |