summaryrefslogtreecommitdiff
path: root/numeric.c
diff options
context:
space:
mode:
Diffstat (limited to 'numeric.c')
-rw-r--r--numeric.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/numeric.c b/numeric.c
index a3cb3be1c8..261c98ad12 100644
--- a/numeric.c
+++ b/numeric.c
@@ -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);
}