diff options
author | Björn-Egil Dahlberg <[email protected]> | 2015-04-01 15:30:12 +0200 |
---|---|---|
committer | Björn-Egil Dahlberg <[email protected]> | 2015-04-10 15:50:36 +0200 |
commit | 2a0ff8b50a68d51e44fddf36867f390b64a4f2bf (patch) | |
tree | d9d090305c992874320ca19dcf9381259e0b8088 /bin | |
parent | cc722af4d62d749d2a75155e91a2a1562aeb2a5a (diff) | |
download | otp-2a0ff8b50a68d51e44fddf36867f390b64a4f2bf.tar.gz otp-2a0ff8b50a68d51e44fddf36867f390b64a4f2bf.tar.bz2 otp-2a0ff8b50a68d51e44fddf36867f390b64a4f2bf.zip |
erts: Ensure hashing of zero is consistent
Erlang treats positive and negative zero as equal, meaning,
true = 0.0 =:= 0.0/-1
However, Erlangs hash functions: hash, phash and phash2 did not
reflect this behaviour. Meaning, the hash values produced by
the different hash functions would not be identical for positive
and negative zero.
This commit ensures that hash value of positive zero is always
produced regardless of the signedness of the zero float, i.e.
true = erlang:phash2(0.0) =:= erlang:phash2(0.0/-1)
Diffstat (limited to 'bin')
0 files changed, 0 insertions, 0 deletions