summaryrefslogtreecommitdiffstats
path: root/numeric.c
diff options
context:
space:
mode:
authoryugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-08-08 15:31:53 +0000
committeryugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-08-08 15:31:53 +0000
commita99bd60e6cc6c4fa66c972172888dea2b50f5043 (patch)
treeee96679611630ab6db6573a8e8afa525541f4276 /numeric.c
parent91910581fcfcecaf7bf05792c6cfc6bfe3f9b6fb (diff)
merges r24361 from trunk into ruby_1_9_1.
-- * numeric.c (flo_hash): normalize -0.0 to 0.0. [ruby-core:24577] git-svn-id: http://svn.ruby-lang.org/repos/ruby/branches/ruby_1_9_1@24458 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
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 a3cb3be1c..261c98ad1 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);
}